Cannot rotate Line geometry

Hi,
Does anybody know why a Line cannot be rotated using this code?:

   [java] Line line = new Line(Vector3f.ZERO, Vector3f.UNIT_Y);
    line.setLineWidth(5f);
    line.setMode(Mode.LineStrip);
    Geometry geometry = new Geometry("line", line );
   ....

    Vector3f geomTranslation = geometry.getLocalTranslation();
    TempVars vars = TempVars.get();
    Vector3f tempVector = vars.vect4;
    tempVector.set(direction).subtractLocal(geomTranslation);

    geometry.getLocalRotation().lookAt(tempVector, Vector3f.UNIT_Y);[/java]

If I replace the line to Cylinder or other solid object it works fine and rotated properly.

Your line is rotating… it’s rotating around the y axis… which also happens to be the line.

Edit: I mean it’s only a guess since you haven’t actually included where direction comes from and it’s the only reason that a line wouldn’t look like it’s rotating.

Forgot to mention that I translate geometry before setting rotation:

[java]geometry.setLocalTranslation(new Vector3f(0, 2, -2));[/java]

direction is: [java]Vector3f direction = new Vector3f(0,3,-4);[/java]

Oh, heheh… you are modifying the result of getLocalRotation() instead of setting it back again. That’s a big no-no as the Geometry does not realize that the transform has been updated.

Ok but why solid geometries are rotate well in this case?
Also if I would use
[java]geometry.lookAt(tempVector, Vector3f.UNIT_Y);[/java]
does not work too.

Make a complete test case if you really still think you have a problem here.