Hello, how can i know the position in 3d space of an element?
For example if i have a sphere that have been translated and rotated many times, how can i know the exact 3d position of this sphere? is there a function or a way to knowing this?
there’s some different ways to do it, one of them is to use a ofxMatrix4x4 to apply the rotations and translations instead of glTranslate/Rotate, then upload that to opengl to apply them to your sphere using glMultMatrix. to calculate the position of the sphere you can just multiply the central point by the matrix.
I can not explain about your question but i can give you basic fundamentals for that.
How can i find my 3d position?. The solution is :
- You need the projection matrix of both projections of 3x2 matrice
- You have the equations : t(x1,y1) = P1 t(x,y,z) and t(x2,y2) = P2 t(x,y,z)
(where t is the transposition of the vector)
- Now you can get a system of 3 unknows and 4 equations
I think this will help you to find out your position.