Ho to orient my 3d object

Hello, when i load the model it is viewed like this:





And i want to view like this:





Being red axis the x’s, green axys the y’s and blue axis the z, i use this functions:

compasBox.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.PI, new Vector3f(0,0,1)));

compasBox.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.PI/2, new Vector3f(1,0,0)));

The first turns up the object and the second should do the rest, but it does not work. What could be the problem? thank you all.


try quaternioninstance.fromAngles(float array), then you specify them with Radians, now use FastMath.DegtoRadiandegree and you can use degree values;



array = new float[3];

array[0] = 90
FastMath.DegToRad;



quaternioninstance.fromAngles(array)

onject.setlocalRotation(quaternioninstance);