about glPerspective

Started by
0 comments, last by karwosts 13 years, 5 months ago
hello everyone, I'm practising with opengl perspective view.

Please look at my code:
http://snipt.net/stevenie/opengl-1?key=4d86d2326ba0331bbcc5bef606dbd482

So far, I can't see anything on the screen. However, if i change the translation from 17 to -17, i can see the sphere. The thing I don't understand is the -17 is not in the interval between [0.1 to 1000], how come it would work? I also notice that its says the z is always positive, how does this work it i want to look at the negative z axis? Thanks!

Steven
Advertisement
The perspective doesn't define the direction that you are looking, only the depth from the camera that fits between the clip planes.

The 0.1 to 1000 just means "draw everything between 0.1 and 1000 units in the direction that my view is facing". It doesn't define whether this is down the positive or negative z axis, or x axis, or whatever axis you happen to be looking down.

By default the view is pointing down the negative z axis, so you see in the perspective view items between -0.1 and -1000z.
[size=2]My Projects:
[size=2]Portfolio Map for Android - Free Visual Portfolio Tracker
[size=2]Electron Flux for Android - Free Puzzle/Logic Game

This topic is closed to new replies.

Advertisement