Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6254343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:09:49+00:00 2026-05-24T14:09:49+00:00

I was wondering how I might adjust a perspective projection to make it look

  • 0

I was wondering how I might adjust a perspective projection to make it look like it was orthographic. For example, say I had a 10×10 grid of points, each with different z values, which under an orthographic projection all lines up nicely. Under a perspective projection it will of course adjust the positions relative to the camera and the z depth. What adjustments do I need to make to each point appear as though it is still lined up and in an orthographic projection? (Until the camera moves of course).

I’m thinking along the lines of calculating a ray from the eye position through the z plane (if that’s what you’d call it) at the point at which I’d like it to appear and following the ray until the required depth. Although I’m not really sure how to implement this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T14:09:51+00:00Added an answer on May 24, 2026 at 2:09 pm

    The typical OpenGL projection matrix (what you get from glFrustum or gluPerspective) puts the camera point at the origin. The plane of projection is at (0, 0, -1): one unit in front of the camera.

    So for a given vertex, what you need to find is the X and Y positions you would get for a projection onto the (0, 0, -1) plane. This is technically “ray tracing”, but since it’s an axis-aligned plane, and the camera is at the origin, it really is just simple arithmetic:

    vec3 newPosition = oldPosition * (-1.0 / oldPosition.z);
    

    Note that interpolating parameters under this perspective projection will be linear in window space, not eye/camera-space. That is, there will be no perspective correct interpolation.

    Also, note that the above “simple arithemtic” does not take into account FOV. To handle that, you need to transform the X and Y of oldPosition by the upper-left part of the perspective matrix. Or just extract the 0,0 and 1,1 values from the projection matrix and multiply them with the X and Y of oldPosition. That takes care of the scaling.


    One more note, since you did not state the overall goal of this.

    OpenGL does not require you to render an entire scene with a single projection matrix. You can render some of a scene orthographically, while using a perspective matrix for the rest. This is often done in games, where the HUD and text elements are rendered orthographically, while the game itself is in a 3D perspective.

    If this is what you’re doing, all you need to do is something like the following:

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(...);
    glMatrixMode(GL_MODELVIEW);
    
    //Render my perspective stuff here.
    
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glOrtho(...);
    glMatrixMode(GL_MODELVIEW);
    
    // Render my orthographic stuff here.
    

    You may want to turn off depth tests during the orthographic rendering, if you have ortho objects that overlap the perspective ones.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Wondering how I might achieve this look with Apache's Indexing? Is there a module
I was wondering how you might be able to update a CURL (PHP) request
I'm struggling getting some unit tests running and wondering if anyone might have anything
I'm a noob at this and was wondering if someone might be able to
I was wondering what approaches others might have for testing domain services against a
I'm wondering if it's possible (recommended might be the better word) to use sed
It might be an obvious question, but I was wondering how do you start
It might be a silly question, but I am wondering what other professionals deal
I'm wondering what kind(s) of data structures / algorithms might help facilitate handling the
I might be doing a coding competition soon, I was wondering if anyone made

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.