[SOLVED] Line-shaped geometry placement

I’m doing sort of target detection task now and to ensure that particular occlusion test goes to right direction trying to use Line shape for geometry.
So I create simple

Line line = new Line(new Vector3f(0,0,0), new Vector3f(0,0,1)); 

(forget the length and endopint for now), creating geometry and trying to place it into the right point like this

Quaternion baseWorldRot = getStateManager().getState(SystemModelState.class).getSpatial(baseId).getWorldRotation();
Vector3f baseWorldLoc = getStateManager().getState(SystemModelState.class).getSpatial(baseId).getWorldTranslation();
geom.setLocalTranslation( baseWorldLoc.add( baseWorldRot.mult( Vector3f.ZERO ) ) );

and it produces very odd results. The lines never start from actual spatial location and seem to be circulating around the origin in some way (as spatial itself advances linearly most of the time, and is positioned where it is supposed to be). I assume local translation specifies start point of the line, am I right about this? If so, what did I miss here? The same method works when I need to place, say, new spatial, in some different place.

Update: Looks like I forgot one angle spatial gets when it’s created. At adds up to world rotation so then the opposite Quaternion should be multed as well.

Will always always always = Vector3f.ZERO.

No matter which way you rotate 0 it will still be 0.

Yep, thanks, I did replace it with UNIT_Z already.

p.s. bad news are I now have to recalc those opposites and subtracts recursively back to core spatial. But that’s doable, no prob :slight_smile: