Rotate node specific value on Z Axis based on the camera

I mean, what part of the javadoc is unclear:
fromAngles builds a Quaternion from the Euler rotation angles (x,y,z) aka (pitch, yaw, rall)). Note that we are applying in order: (y, z, x) aka (yaw, roll, pitch) but we’ve ordered them in x, y, and z for convenience.

Unless I’m mistunderstood and I’m over-simplifying the problem, then you should be able to do this by some code like this, without having to worry about the rotations much.

Vector3f lookDir = cam.getDirection().clone();
lookDir.setY(0);
player.viewDirection = lookDir;

This way you just simply set the camera view direction, leaving out the y value . So then your character should always look the same direction as the camera, but won’t flip around and go upside down if you look backwards,

1 Like

@yaRnMcDonuts
YES!!! I knew it wouldnt be that hard, you really made my day.
Thanks a lot!!! that is exactly and exactly what i want

Is it just the two directions?

Didn’t know it was a feature in games players expect but I like it. Combined with snapping camera to true north or south make it a nice feature.

off topic, but its possible the editor has problems importing models from blender which uses cyles render?

This problem is solved btw :smiley: thx to @yaRnMcDonuts

I think materials are affected from things I’ve read in the wiki. Other than that, I’m not sure.