Re: Model View Transformation
"priyadarshi" <[email protected]> Wed, 15 Oct 2008 21:50:34 -0800
| Newsgroups | gmane.games.devel.opengl |
|---|---|
| Organization | Fat City Network Services, San Diego, California |
| Message-ID | <[email protected]> |
glOrtho(GLdouble left, GLdouble right, GLdouble bottom,GLdouble top,GLdouble near, GLdouble far) "Remember that with the projection commands, the near and far coordinates measure distance from the viewpoint and that (by default) you're looking down the negative z axis. Thus, if the near value is 1.0 and the far 3.0, objects must have z coordinates between -1.0 and -3.0 in order to be visible." - RedBook > 1) You're seeing the back face of the back face of your cube. I am not > sure > exactly why this is happening .. but may be your eye is right on the near > plane. Paste some code and we can analyze it better. > > 2) View volume is defined in eye-space so the direction of camera doesn't > matter. View volume will always be aligned with where the camera is > looking. The camera is too far, you are correct. The far clipping plane > is > closer to you than the box you're trying to view. > > > On Wed, Oct 15, 2008 at 1:10 PM, Mohan Parthasarathy > <[email protected]>wrote: > >> Hi, >> >> I am able to see the cube. So, my view volume should be right, no ? I >> was >> mainly trying to understand my observations as to what happens when i >> move >> around the camera ? What do you mean by "in the direction of the camera" >> ? >> Can you explain ? >> >> thx >> mohan >> >> >> >> On Tue, Oct 14, 2008 at 6:50 PM, priyadarshi >> <[email protected]>wrote: >> >>> You are not setting up the projection matrix correctly. Both the near >>> plane and far plane( of the view volume) should be located in the >>> direction in which camera is looking. >>> All objects outside the view volume will be culled so make sure the >>> cube >>> is inside the view volume. >>> >>> > Hi, >>> > >>> > I am drawing a cube (2 units on all sides) that extends from -1 to 1 >>> on >>> Z >>> > axis. I have defined a view volume (parallel projection) that covers >>> 3 >>> > units >>> > on all sides (glOrtho (-3.0, 3.0, -3.0,3.0,-3.0,3.0). The cube faces >>> are >>> > differently colored so that i know what faces i am looking >>> > at. The camera by default is at (0,0,0). >>> > >>> > 1) glTranslate on Z axis with 0.0, 1.0 and 2.0, i see the front face. >>> If >>> i >>> > move greater than 2.0 units, i see the back face. I am unable to >>> explain >>> > this. Isn't the camera pointing towards the -Z axis at the begninning >>> ? >>> > Then >>> > why am i seeing the front face. Then when i cross 2 units, i see the >>> back >>> > face. I am unable to understand this. To see the front face, don't i >>> have >>> > to >>> > be in front of the cube i.e something like -1.1 ? Also, for seeing >>> the >>> > back >>> > face, don't i have to move forward at least 1.1 and then turn around >>> ? I >>> > am >>> > confused. >>> > >>> > 2) glTranslate on Z axis with values > 4.0 or -4.0, i don't see the >>> cube. >>> > I >>> > can see that the camera/viewpoint is too far. What is too far ? How >>> do >>> i >>> > know that i have gone too far without trying different values ? >>> > >>> > >>> > Thanks for any help. >>> > mohan >>> > >>> >>> ----- >>> FAQ and OpenGL Resources at: >>> http://www.geocities.com/SiliconValley/Hills/9956/OpenGL >>> >>> -- >>> Author: priyadarshi >>> INET: [email protected] >>> >>> Fat City Hosting, San Diego, California -- http://www.fatcity.com >>> --------------------------------------------------------------------- >>> To REMOVE yourself from this mailing list, send an E-Mail message >>> to: [email protected] (note EXACT spelling of 'ListGuru') and in >>> the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L >>> (or the name of mailing list you want to be removed from). You may >>> also send the HELP command for other information (like subscribing). >>> >> >> > > > -- > Uday > http://soundc.de/ > ----- FAQ and OpenGL Resources at: http://www.geocities.com/SiliconValley/Hills/9956/OpenGL -- Author: priyadarshi INET: [email protected] Fat City Hosting, San Diego, California -- http://www.fatcity.com --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [email protected] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).