Results 1 to 2 of 2

Thread: How to convert vrml viewpoint to glulookat?

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    new york
    Posts
    1

    How to convert vrml viewpoint to glulookat?

    Does anyone know how to convert vrml viewpoint which has to following attributes:

    fieldOfView fov_angle
    orientation x, y, z, angle
    position x, y, z

    to a gluLookAt, which composes of position,
    aim, and up vectors.

    Any help or web page link will be much appreciated. Many thanks.

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

    Re: How to convert vrml viewpoint to glulookat?

    >fieldOfView fov_angle
    >orientation x, y, z, angle
    >position x, y, z

    Here is what I did in my VRML loader:

    void ViewpointDisplay(VIEWPOINT *viewpoint)
    {
    if (viewpoint != NULL)
    {
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(viewpoint->fieldOfView * RAD2DEG, dAspect, zNear, zFar);
    glRotatef(-viewpoint->orientation[3] * RAD2DEG, viewpoint->orientation[0], viewpoint->orientation[1], viewpoint->orientation[2]);
    glTranslate(-viewpoint->position[0],-viewpoint->position[1], -viewpoint->position[2]);

    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    }
    }

Similar Threads

  1. How could I set the camera viewpoint in GLES2..0
    By lovelyboy in forum OpenGL: GLSL
    Replies: 0
    Last Post: 10-14-2010, 07:24 AM
  2. Convert modelview matrix for use in gluLookAt()
    By khoyee in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-31-2010, 08:37 PM
  3. changing viewpoint
    By jenny in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-15-2002, 08:36 PM
  4. Viewpoint Movement
    By plates in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-31-2001, 07:49 PM
  5. Making a camera or viewpoint?
    By Siwko in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 05-05-2001, 04:54 AM

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