I am currently making a 2d mini-map for my HUD. The HUD itself uses the ORTHO system, and I've been having a few problems with some of the conversions between the 2d and 3d spaces.
To position given nodes on the mini-map I am using their local translation (subtracted from the player node). This, obviously, puts the player at the center of the map (at distance 0,0,0 from itself) and the other nodes move around this point. Super! Exactly what I wanted!
To do this I am having to do the following (put the z -> y, and clear z):
//Get new position
Vector3f newPosition = new Vector3f(
currentBlipLocation.x,
currentBlipLocation.z,
0
);
I understand that this is something to do with the way that the 3D is flattened into the 2D ORTHO thingy.
My question is... how do I deal with a quaternion / rotation?
Basically, I want to represent enemies with a triangle, with the tip of the triangle facing the same direction that the model is. I can access the model's local rotation, but I have no idea how to use it (or what the "w" element is).
Quaternions have a few helpful methods which abstract their complex mechanics… Try using Quaternion.fromAngles(), with the angle of rotation being in the 3rd argument (Z-axis).