Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Points disappear when glScaling....

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2001
    Posts
    28

    Points disappear when glScaling....

    Hi,

    I'm writing a modeling program, in this program I draw points to display fe. selected points.

    This works fine on my machine and some others but when I tested it on a PII Linux machine and on a portable with W98 the drawing gets messed-up when zooming.

    For this zooming I always use glScale( );


    What could be the problem here ?

    Is this purely related to the video-drivers or did I forget something ?

    Code to draw points :
    ======================

    for (int i=0; i < nrPoints; ++i )
    {
    if(!data[ ss->directIndex[i] ]->isFlag(a_iFlag))
    continue;
    }

    glBegin( GL_POINTS );

    glVertex3d( data[ ss->directIndex[i] ]->x,
    data[ ss->directIndex[i] ]->y,
    data[ ss->directIndex[i] ]->z );

    glEnd();

    }

    Code to zoom :
    ======================
    glScalef( viewer->zf, viewer->zf, viewer->zf );
    U.P

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: Points disappear when glScaling....

    Maybe they are disappearing behind your far clip plane.
    Deiussum
    Software Engineer and OpenGL enthusiast

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2001
    Posts
    28

    Re: Points disappear when glScaling....

    I'm not using clipping planes at this moment...

    Could it be that clipping plane defaults are different on different OpenGL implementations ???
    U.P

  4. #4
    Intern Newbie
    Join Date
    Apr 2001
    Location
    FL, USA
    Posts
    36

    Re: Points disappear when glScaling....

    Originally posted by Uther_Pendragon:
    I'm not using clipping planes at this moment...

    Could it be that clipping plane defaults are different on different OpenGL implementations ???
    Yes, OpenGL defaults a near clipping plane (for integrity purposes) but I'm not sure it enforces the far clipping plane. I imagine that is does, but the point is to control your points so that they inhabit your view frustrum.

    You can either change the far clipping plane in your projection functions (e.g. glOrtho, glFrustrum) or reduce the size of your units (i.e. 1unit=1m to 1unit=10m).
    When in doubt, press F1.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: Points disappear when glScaling....

    Originally posted by Uther_Pendragon:
    I'm not using clipping planes at this moment...

    Could it be that clipping plane defaults are different on different OpenGL implementations ???
    Not using clipping planes?!? You are saying you don't use ANYTHING to setup your projection matrix? (gluPerspective, glFrustum, glOrtho, etc.)

    If that is the case, I would definitely setup your projection matrix before doing anything else.
    Deiussum
    Software Engineer and OpenGL enthusiast

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2001
    Posts
    28

    Re: Points disappear when glScaling....

    Sorry, I meanth no 'additional' clipping planes ;-)
    U.P

  7. #7
    Junior Member Newbie
    Join Date
    Mar 2001
    Posts
    28

    Re: Points disappear when glScaling....

    I've set the clipping planes to :

    near = 0.001f;
    far = 10000.0f;

    ... still the same problem....
    U.P

  8. #8
    Intern Newbie
    Join Date
    Apr 2001
    Location
    FL, USA
    Posts
    36

    Re: Points disappear when glScaling....

    Originally posted by Uther_Pendragon:

    I've set the clipping planes to :

    near = 0.001f;
    far = 10000.0f;

    ... still the same problem....
    Are you able to see them without using glScalef() ?
    When in doubt, press F1.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: Points disappear when glScaling....

    When do you call the glScale function? Do you use anything like gluLookAt, glRotate, or glTranslate? If so, in what order are all these in relation to your glScale?
    Deiussum
    Software Engineer and OpenGL enthusiast

  10. #10
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: Points disappear when glScaling....

    shot in the dark
    perhaps u have lighting enabled, and scaling is causing your normals to go haywire.
    note im not to sure if points have normals but its worth a shot

Posting Permissions

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