Results 1 to 6 of 6

Thread: Is it OK ?

  1. #1
    Member Contributor
    Join Date
    Nov 2002
    Location
    Oirsbeek,Holland
    Posts
    69

    Is it OK ?

    I'm trying to use gluUnProject, can somebody tell me, if the following source code should work ? I tryed on my computer, but it kind of froze, i don't know if it is my win or the bad source code. Myska is type GLdouble.

    GLdouble ObjX;
    GLdouble ObjY;
    GLdouble ObjZ;
    GLdouble ModelViewMatrix;
    glGetDoublev(GL_MODELVIEW_MATRIX,&ModelViewMatrix) ;
    GLdouble ProjectionMatrix;
    glGetDoublev(GL_PROJECTION_MATRIX,&ProjectionMatri x);
    GLint ViewPort;
    glGetIntegerv(GL_VIEWPORT,&ViewPort);
    gluUnProject(Myska.Xpos,Myska.Ypos,1.0,ModelViewMa trix,ProjectionMatrix,ViewPort,&ObjX,&ObjY,&ObjZ);

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Is it OK ?

    Define your variables like this instead.
    Code :
    GLdouble ModelViewMatrix[16];
    GLdouble ProjectionMatrix[16];
    GLint ViewPort[4];

  3. #3
    Member Contributor
    Join Date
    Nov 2002
    Location
    Oirsbeek,Holland
    Posts
    69

    Re: Is it OK ?

    it works, but kind of wierd i think. The number which i get are not ok. Can somebody help me ?

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: Is it OK ?

    The numbers you get are correct with respect to what you pass, there's nothing wrong with gluUnProject. I would say you don't know what you get from it, or don't know what to pass to it to get what you want.

    Tell us what you want and maybe we can help more.

  5. #5
    Member Contributor
    Join Date
    Nov 2002
    Location
    Oirsbeek,Holland
    Posts
    69

    Re: Is it OK ?

    i would like to get position of mouse pointer in opengl scene (x,y,z)

  6. #6
    Member Contributor
    Join Date
    Nov 2002
    Location
    Oirsbeek,Holland
    Posts
    69

    Re: Is it OK ?

    Originally posted by jirkamelich:
    i would like to get position of mouse pointer in opengl scene (x,y,z)

    do you know some good tutorial about gluUnProject ? I read some old questions abouit gluUnProject, and i think that it's quite difficult to get the gluUnProject work.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean