Florin Bratu
11-28-2005, 06:35 AM
Hello!
From as far as I read, the most widely-used graphic systems do projections by first defining a "canonica volume" in which all the objects will be fitted, and eventually clipped, and then the actual projection will take place in that volume.
Now, from the theory, projection transformations map a 3d object on a 2d plane (the general case is n dimension obj on an n-1 dimension space).
My question is : how can I calculate a projection matrix for a particular projection, in order to comply with this model? i.e. the "canonical volume" model?
Example : I want to define an oblic projection in OpenGL. I have calculated the following projection matrix:
GLdouble g_dOblicProj[]={
1 , 0 , -0.5 , 0 ,
0 , 1 , 3.25 , 0 ,
0 , 0 , 0 , 0,
0 , 0 , 0 , 1
};
But when I load it using glLoadMatrix, I get the same effect as though I was using an orthographic projection
what are the changes required in order to make it work?
From as far as I read, the most widely-used graphic systems do projections by first defining a "canonica volume" in which all the objects will be fitted, and eventually clipped, and then the actual projection will take place in that volume.
Now, from the theory, projection transformations map a 3d object on a 2d plane (the general case is n dimension obj on an n-1 dimension space).
My question is : how can I calculate a projection matrix for a particular projection, in order to comply with this model? i.e. the "canonical volume" model?
Example : I want to define an oblic projection in OpenGL. I have calculated the following projection matrix:
GLdouble g_dOblicProj[]={
1 , 0 , -0.5 , 0 ,
0 , 1 , 3.25 , 0 ,
0 , 0 , 0 , 0,
0 , 0 , 0 , 1
};
But when I load it using glLoadMatrix, I get the same effect as though I was using an orthographic projection
what are the changes required in order to make it work?