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

Thread: Location of object?

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2001
    Location
    Storrs
    Posts
    4

    Location of object?

    Hey I'm a newbie at OpenGL. I've got a SolidSphere in space somewhere, but I can't seem to find where it is?? How can I find out where OpenGL placed the sphere when I created it? Here's some of my code :


    float a,b,c=0.0;
    float d,e=0.0;
    float f=-5.0;
    float g=0.0;
    float h=1.0;
    float i=0.0;

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glMatrixMode(GL_MODELVIEW);
    glPushMatrix();
    gluLookAt(a,b,c,d,e,f,g,h,i);
    glutSolidSphere(1.0, 20.0, 16.0);
    glPopMatrix();

    Does any one know where my sphere is ??

    Thanks a lot!!!

    -Ian

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,768

    Re: Location of object?

    The sphere is at the origin. Since the camera is at the origin, you are inside the sphere.

    Change your gluLookAt call so that you are at, say, 40 units away from the origin.

Posting Permissions

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