need help in a math problem

Blitz3D Forums/Blitz3D Programming/need help in a math problem

Charrua(Posted 2008) [#1]
Supose I have a camera (not a blitz 3d camera, a real camera), and is infront of a box. Exactly infront as seen in that picture



if we move the camera, the perspective, the way the red dots are seeing from the camera change. The real camera, send me the coordinates of the 4 points (that's not my problem) as seen in the second picture



the question:
any one knows how to calculate the position and orientation of the camera in the real world based on the coordinates of the four points?

I supose that with 3 points should be enough to do the calculation but I have no scientific probes of that.

Does any one know the maths involved, or were to look for?

thank's

By the way, the camera is the one that cames in a WiiMote, I'm doing some experimet's with it. The idea is to move a blitz camera, based on the information of the movement of the wiimote respect to the screen.

Juan


nawi(Posted 2008) [#2]
I would look at some 3d projection math, get the formulas and inverse them. I think you'll have some general formula that can give an infinite number of possible positions for each of the dot, then you need to calculate the one where each dot is exactly the same distance away from each other.

Look here:
http://www.gamedev.net/reference/articles/article795.asp


Charrua(Posted 2008) [#3]
thank's nawi, great link!

i realize that I will finish with systems of equation's (matrix...) but if some one did that work and want to contribute, welcome.

thank's again for your time

Juan