Camera - Matrix

Recommended Posts

Hi guys, So basically what i am trying to do is to project some points in 3d space to a 2d monitor from a variety of camera locations and camera directions (basically first person) After some help from u guys, i've gone to use matrices Right now i have my Camera Translation Matrix (CT) Rotation Matrices (x,y,z) (CX, CY, CZ) now im stuck can someone please clarify what to do once i have these matrices http://en.wikipedia.org/wiki/3D_projection http://www.gamedev.net/reference/articles/article417.asp the sites seem to have conflicting ideas To get the 2D point am i suppose to do this double[] 3dpoint = new double[4]; 3dpoint[0] = xpoint; 3dpoint[1] = ypoint; 3dpoint[2] = zpoint; 3dpoint[3] = 1; double[] 2dmatrix = CT * CX * CY * CZ * 3dpoint; is the above line correct? if not, what should it be? THANKS

Share on other sites
Quote:
 Original post by azniumdouble[] 2dmatrix = CT * CX * CY * CZ * 3dpoint;
This doesn't have anything to do with projecting a point to screen space; it actually transforms the point from camera local space into world space, which you'd only be doing if, say, you were rendering a model that represented the camera. By the way, is this C++?

The following:
inv(CZ)*inv(CY)*inv(CX)*inv(CT)*3dpoint
Is the first step towards getting a point to screen space. The above can be expressed in other ways as well, such as concatenating the matrices first and then inverting. Also, the inversions here are more or less trivial; they're not general inversions.

After that comes transformation into clip space via the projection matrix, and then perspective division.

Share on other sites
thanks jyk

i think i got my first 3d engine running

no, im not using C++, im using java (applet...i never liked how win32 drew stuff and i want to stay away from OpenGL and DirectX for now)

Quote:
 After that comes transformation into clip space via the projection matrix, and then perspective division.

i read something about perspective division and im about to implement it, but i never saw anything about perojection matrix, can u elaborate?

Create an account

Register a new account

• Forum Statistics

• Total Topics
628336
• Total Posts
2982158

• 9
• 24
• 9
• 9
• 13