Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 23 May 2013
Offline Last Active Apr 30 2014 01:00 PM

Topics I've Started

libGDX Quaternion.getAxisAngle(Vector3, float) returns only values between 0 and 180

24 November 2013 - 05:18 AM

Hey guys,


I may have encountered a bug, but I'm not sure, maybe this is the way quaternions work.


I try to calculate the models roatation based on the camera angle, the angle of the analog stick, the model angle and the time.

So far my code works out well as long as my model keeps being rotated between 0 and 180 degrees (counterclockwise, along y-Axis, y-Up). To get the ModelInstance's rotation (still along y) I use

Quaternion quatRotation = new Quaternion;
float rotation = quatRotation.getAxisAngle(new Vector3 (0f, 1f, 0f)) % 360f;

but rotation is always between 0f and 180f. Even if I'd expect (because I see it on my display) the value to be e.g. -6f it still is 6f. So basically the rotation gets mirrored along x-Axis.


Do I do anything wrong or is this a bug within libGDX?


Thanks in advance


get a vertex B from vertex A and Quaternion

18 November 2013 - 06:24 AM

Hello guys,

I have a problem with my third person camera. I want to find out the position of the camera and the position of the look at spot. I know how to calculate this with α, β and γ angles but I really don't have a clue how to calculate verticex B based on a vertex A, a quaternion and a distance between vertices A and B.


It would be great if anyone could provide formulars or point the direction to go.




Reflection on Uneven Planes

23 May 2013 - 01:32 PM

Hey guys,


I have searched through the internet the wole day now but I could not find an answer to that big question.

What about reflection on uneven planes?


Of course for reflection on even planes like a standard mirror you can mirror along the plane, turn on stencilbuffer, turn off depthbuffering and draw all again, but what about convex or concave surfaces (e.g. a car chasey)?


Thanks in advance