Sign in to follow this  
anupgupta

Camera Projection

Recommended Posts

anupgupta    128
hello I am working on a 2D side scrolling game using c++ and opengl... I am am bit lost at whether to use perspective projection or orthogonal projection for a 2d game...I have a player which is moving and the camera is following the player... I would like to know in what situations are these two projections used and what effect do they have on the game.. some explanations and examples on this would be of great help...

Share this post


Link to post
Share on other sites
I would use Orthagonal.
IIRC, ortho projection means everything appears at its actual size. Perspective projection means everything changes size depending on how far from the camera it is.
If you have your camera at 0,0,0, looking down negative z, and a triangle at say 0,0,-10. If this moved to 0,0,-20, then there would be no size difference with glOrtho. However, it would appear smaller(half size?) with glPerspective.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this