Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

jho

Orthographic projection?

This topic is 6477 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve forgotten how to implement orthographic projection.. if I just disregard the Z information, how do I zoom in? scale the model?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You can''t zoom in. With orthographic projections you don''t get any perspective (i.e. objects look the same size however far away they are).

You can, however, scale the model by multiplying all of the vertices by a scaling matrix.

Share this post


Link to post
Share on other sites
First the ortho projection matrix is:

1 0 0 0
0 1 0 0
0 0 0 0
0 0 0 1

With this matrix, you can view the polygones who are in range [-1,1] for x and y.

If you change this matrix for:

50 0 0 0
0 50 0 0
0 0 0 0
0 0 0 1

You can view the polygones who are in range [-50,50] for x and y.
You can zoom in the scene just by change the projection matrix.

Share this post


Link to post
Share on other sites
If you are using opengl you can simulate zooming by changing the parameters for glortho. Make the right and top greater and the left and bottom smaller and you fit more in your viewport, zoom out. Reverse the process and you zoomin. Not sure if this is a good way of doing this but it does work.

I wanrned you! Didn't I warn you?! That colored chalk was forged by Lucifer himself!

Share this post


Link to post
Share on other sites
Sorry I have make a little error in my previous message.

The second matrix is:

1/50 0 0 0
0 1/50 0 0
0 0 0 0
0 0 0 1

It''s with this matrix that you view polygones in [-50,50] range.

Share this post


Link to post
Share on other sites
Ok no problem, I''m sure I will find out the different between 1/50 and 50 when I see it

however I''m just doing a 3D->2D display (discarding Z) and NO rotations. I found it just faster processing time to just take the X and Y and scale it and translate it without using a matrix.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!