0

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

Taks
  • 1,853
  • 4
  • 16
  • 23
  • It is not clear what you are trying to achive but [I wouldn't use Euler angles](http://stackoverflow.com/a/5578867/341970). – Ali Feb 10 '12 at 16:10
  • I have transformation matrix/euler angles.. I want to make Direction Unit Vector out of these. – Taks Feb 10 '12 at 16:54

0 Answers0