Strange LEDBar behavior

Post Reply
Chris De Rock
Posts: 103
Joined: Tue Apr 14, 2015 6:54 am
Real Name:

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
User avatar
mcallegari
Posts: 4482
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

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.
Post Reply