Strange LEDBar behavior
Posted: Mon Nov 26, 2018 1:24 pm
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
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