Page 1 of 1

Strange LEDBar behavior

Posted: Mon Nov 26, 2018 1:24 pm
by Chris De Rock
First: i know, this is WIP....
Now: i was happy to see the LEDBars in the 3d view and played around. and by moving the bar via the position-controls i see that the distance between single beams changed with the movement. ok... as i say it is WIP but i wanted to see a working LEDBar so here my fix:

in file MultiBeams3DItem.qml you have the function "setHeadLightProps" and here you caculate the pos.x of the head as "var hPos = Qt.vector3d(pos.x * h, pos.y, pos.z)". i changed that to:
--SNIP--
var offset = ((phySize.x / headsNumber) * h)
var hPos = Qt.vector3d(pos.x + offset, pos.y, pos.z)
--SNIP--
and now the distance between the beams is fixed. cool ;) but wait. the first beam is in the middle of the fixture. so here we go
--SNIP--
var offset = ((phySize.x / headsNumber) * h) - (phySize.x / 2)
var hPos = Qt.vector3d(pos.x + offset, pos.y, pos.z)
--SNIP--
and now its fine ;)

hope that helps a little bit

Re: Strange LEDBar behavior

Posted: Mon Nov 26, 2018 2:21 pm
by mcallegari
Multi beam bars are broken.
That calculation is there only to see something. I already knew it was wrong.
Your changes are not a fix anyway, since there are matrices involved that need to be calculated in C++ (updateLightMatrix)
Try to rotate the bar and you'll see all the issues.