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 6808471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:57:35+00:00 2026-05-26T19:57:35+00:00

As shown in the picture my object has its own local coordinate system.(Actually I

  • 0

enter image description here

As shown in the picture my object has its own “local coordinate system”.(Actually I have a pointcloud instead of a mesh)

Then I apply transformations/scaling..etc to ModelView matrix and transformed coordinate system is “modelview coordinate system”.

Now I am tring to pick of “vertex” using gluUnproject as follows.

GLint viewport[4];
GLdouble modelview[16];
GLdouble projection[16];
GLfloat winX, winY, winZ;


glGetDoublev(GL_MODELVIEW_MATRIX, modelview);
glGetDoublev(GL_PROJECTION_MATRIX, projection);
glGetIntegerv(GL_VIEWPORT, viewport);

winX = (GLfloat) mousePosition.x();
winY = (GLfloat) viewport[3] - (float) mousePosition.y();
glReadPixels((int)winX , int(winY) , 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT,&winZ);

GLdouble posX, posY, posZ;
gluUnProject( winX, winY, winZ, modelview, projection, viewport, &posX, &posY, &posZ);

Does this “gluUnProject” should give me the location relative to the “local coordinate system” or is it relative to the “modelview coordinate system” ?

  • 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-26T19:57:36+00:00Added an answer on May 26, 2026 at 7:57 pm

    Modelview is not a (particular) coordinate system, but the transformation from object local space (model-) to eye space (-view).

    In the picture above we see object space (the tripod “in” the teapot), and world space (the large tripod). But then there’s eye space, for which no tripod is given, though we can imagine it easy enough: One vertical axis up and one horizontal axis right in the middle and a axis sticking out of the picture.

    What we don’t “see” is the projection, i.e. the transformation that projects the picture to the screen (technically clip space, then from there to NDC by a additional step).

    So we have the following transformations:

    • Modelview, MV, from object space to eye space (this completely bypasses the world space)
    • Projection P, from world space to screen space.

    A vertex goes through those

     v_eye = MV * v
     v_clip = P * v_eye = P * (MV * v) = P * MV * v
    

    thereafter the clip to NDC-transformation is applied.

     [x,y,depth] = clip_to_NDC( v_clip ) = clip_to_NDC(P * MV * v)
    

    What gluUnProject does is the reversal of just the above expression:

     gluUnProject(MV, P, x, y, depth):
    
     v_clip = clip_to_NDC^-1([x,y,depth])
     v = MV^-1 * P^-1 * v_clip = MV^-1 * P^-1 * clip_to_NDC^-1([x,y,depth])
    

    Or in other words given the modelview and projection matrix, gluUnProject will project back from screen space into the space transformed there by the transformation chain.

    It also helps to remember that OpenGL is not a scene graph, i.e. it doesn’t keep track of all the transformations, objects you’ve drawn, etc. It “lives for the moment” if you want to say so.

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

Sidebar

Related Questions

I want to achieve was is shown on the picture above. I have a
I have a an object of type Picture that contains a List Comments see
I have a Panel as a container this panel has a picture on it
I have two Data Base which is shown in the attacted picture I have
Could you suggest me a good Flex component for the widget shown in picture
Why is the tab icon hidden as shown in the picture?
I am trying to remove/edit the text shown in the picture which appears from
The qustion was modified by me to show a complete picture. I have a
I have a textbox in my application and as the picture below shows, by
I have a simple application that has a single page with a button that

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.