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 6 of 6

Thread: position

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    Montreal, Qc CA
    Posts
    5

    position

    Hi guys,
    I'm drawing a pseudo-nurbs with line strips and draw the points and I want to draw the control vectors :
    glMap2f( GL_MAP2_VERTEX_3,...)
    // draw strips
    // then draw points
    for ( w=0; w<WidNbr; w++ )
    for ( h=0; h<HgtNbr; h++ )
    {
    glBegin( GL_POINTS );
    glEvalCoord2f( [x],[y] );
    glEnd();
    }
    and I try to get back the real position of each point.
    I have tried with glGetFloatv and glGetMapfv but I can't get it.

    Any idea?
    Thanks
    Pierre

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: position

    glEval...() is not updating the current state, as far as I remember, so glGet...() on the current vertex will return the last glVertex() data instead.

    I haven't understood the meaning of "control vectors" though. Do you mean the first derivatives in u and v direction at each point?

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    Montreal, Qc CA
    Posts
    5

    Re: position

    Hi Relic,
    Thanks for your answer,
    My mean is to find the XYZ coordinates of the point I just drawn.
    If glEval doesn't update this data is there any other way to get this information(without recalculate with algorythms :-(
    Regards
    Pierre

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: position

    Sounds as if glRenderMode(GL_FEEDBACK) would return the data. That doesn't draw anything and isn't hardware accelerated normally.
    But feedback is something I largely avoid.
    Have a look in feedback.c of the redbook examples.
    I did Bezier and B-spline patches myself after I had some weird experiences with two sided lighting with glEval. Haven't used glMap since then.

  5. #5
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    Montreal, Qc CA
    Posts
    5

    Re: position

    So if you don't use glMap, what do you do? Do the calculations?
    Do you think NURBS is more reliable?

  6. #6
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: position

    Depends on what you want to do. Knowing what happens in the graphics is always a plus.
    I have written some algorithms which calculate the surface and normals of freeform patches for personal research. It's quick enough to be realtime editable, but I don't know how the code looks like anymore(three years ago, maybe), so I cannot offer it.
    I rely on basic OpenGL features mainly. Stuff in libs I have no source access to must work or I simply kick it.
    NURBS have less polygons than my algorithm, which simply interpolates in constant steps on u and v.
    Give it a try. It's not that complicated with the glu lib, but if you need the final vertices for storing models you'll need the feedback buffer.

Posting Permissions

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