2

How does one rotate a model and change the forward direction of it with the rotation?

I rotate but it just rotates on the axis and the forward is still the same.

This is probably a noob question but it's been kicking me buttocks.

Dr. Chocolate
  • 2,043
  • 4
  • 25
  • 45

1 Answers1

4

You can use look at method to rotate your spatial to a target point. Below sample makes a spatial look at camera with up vector 1,0,0

spatial_x.lookAt(cam.getLocation(),new Vector3f(1,0,0));

If you just want to rotate about x axis for 0.2 radians:

spatial_x.rotate(0.2,0,0);

Y axis for 1 radian and Z axis for 3 radians:

spatial_x.rotate(0,1,3);
huseyin tugrul buyukisik
  • 11,469
  • 4
  • 45
  • 97