I am working on artoolkit which is Augmented Reality Engine. The engine takes input from camera, looks for marker and creates transformation matrix of the camera. When I inverse the transformation matrix I am able to extract Transformations and translation of the camera in marker coordinate system.
cameraX = transformationMatrix[0][3]
cameraY = transformationMatrix[1][3]
cameraZ = transformationMatrix[2][3]
I have also method getAngle, which whill give me three Euler angles from the transformation matrix. (Source: http://artoolkit.sourceforge.net/apidoc/ar_8h.html#a91c0942b8061abae28060cfd548ed2a ) I would like to create Direction unit vector out of these three Euler angles. By Having this direction unit vector I could make impression that player is shooting bullets from the camera in perpendicular to the phone's camera surface direction. The bullet would start with a position of camera X Y Z, and further position would be old position + unit vector multiplied by velocity in time delta.....
Am I doing it right? And how to extract this direction vector from euler angles. Thanks