Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 7 of 7

Thread: getting vertices coordinates

  1. #1
    Guest

    getting vertices coordinates

    hi guys i need your help

    i got a simple problem...
    i got a 3d model displayed...
    now want i want is, clicking on the model with the mouse and getting the coordinates of the nearest vertex to the mouse pointer.

    in other words i need a selection-vertex function which is included in every 3d modelling pogramm.

    i know i have to caculate from 2d mouse coords to 3d model coords.. but i dont know how?!?!

    have you got any tutorials on this ??
    or can you write me the basics?

    p.s. i cannot use any glut functions only opengl!
    glut is not allowed in my c++ code (dont ask why )

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,651

    Re: getting vertices coordinates

    Hi !

    gluUnProject() can do the 2D to 3D conversion for you but it may not be of much help because you don't know the Z value.

    Why can't you just use selection mode to find the hits ?

    Mikael

  3. #3
    Guest

    Re: getting vertices coordinates

    hi again

    as i said i CANT use glut functions

    GLUunproject is glut

  4. #4
    Member Regular Contributor CrazyButcher's Avatar
    Join Date
    Jan 2004
    Location
    Germany
    Posts
    402

    Re: getting vertices coordinates

    glu is not glut
    so if you say you cant use glut
    gluunproject is still valid being part of glu

  5. #5
    Guest

    Re: getting vertices coordinates

    Originally posted by <dawnbuffy>:
    GLUunproject is glut
    Nope, its part of GLU but not GLUT, the T makes quiet a difference.

  6. #6
    Guest

    Re: getting vertices coordinates

    ahh sorry i didnt no that

    thx guys

    lets say i cant use any glu or glut functions
    how do i get from 2d screen coords to 3d vertex coords then?

  7. #7
    Guest

    Re: getting vertices coordinates

    didnt know that i mean.. hrhr

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •