need help with projection matrix

Trying to incorporate camera data from another app into my OpenGL app.

I have a rotation matrix (3x3) and a simple translation (x,y,z), but I can’t get them to work together properly as a projection matrix.
Which way do I have to go?
First the translation and then a glMultiMatrix does not do the trick. The rotation matrix on its own seems ok though.

Thanks for any help!

Well, projection is different from translation and rotation. Also, you need to be using 4x4 matricies, since opengl uses homogeneous coordinates.

The simplest form of a projection matrix is

1 0 0 0
0 1 0 0
0 0 f 0

where f is the focal length of the camera. Neither translation nor rotation know about the focal length of the camera.

I can’t really say more than that, because I don’t know what it is you’re trying to do. If you want to translate, rotate and proejct, then all you need to do is set up your projection and modelview matricies appropriately, and give opengl some primitvies. If you want to do all the grungy maths yourself, then you’ll need to also have a projection matrix, which could be as simple as the one above (with the caveat you’ll need an extra row to make it homogenous).

The order of your translation and rotation vectors is important, but it depends on what you want to do (ie. the difference between rotating the earth on its axis, or making the moon orbit the earth).

hope some of this make sense…

cheers,
John