Results 1 to 7 of 7

Thread: Perspective

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    chicoutimi canada (quebec)
    Posts
    10

    Perspective

    I don't have any experience with perspective but i understand the system. My problem is when i define my environnement with gluPerspective or with glFrustum i have very weird view of my objects on screen, somewhat dark and my pieces look very weird (there is full of line that appears an disappears in place of filled polygons) When i'm in glOrtho mode there is no problems. So do i had forgot to add lines or it's my light or what?? thanks!

  2. #2

    Re: Perspective

    What kind of calls to gluPerspective and glOrtho do you use? Paste some code here. And no, it is definitely not a lighting problem

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    5

    Re: Perspective

    You should find all you need to know on this site.
    <http://heron.cc.ukans.edu/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG/@Generic__BookView;cs=fullhtml;lang=sv>

    The chapter 3 is on Viewing...

    PS: J'ai vu dans ton profile que tu reste à chicoutimi (et que tu dois donc parler français aussi) moi je viens de Jonquière ça fait drôle de voir du monde de la région dans ce forum. Salut!!!

  4. #4
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    chicoutimi canada (quebec)
    Posts
    10

    Re: Perspective

    Here is an exemple of my init code for gluPerspective

    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(45.0,1,0,10);
    gluLookAt(0,0,0,0,0,-15,0,1,0);
    glMatrixMode(GL_MODELVIEW);

    My object is at (0.0,0.0,-10.0) i see it but not the way it should be.

    P.S. Salut Popol c'est vrai que sa fait drole de voir quelqu'un de la region c cool!

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    5

    Re: Perspective

    First of all i think gluPerspective only take 4 parameters (not 5).
    Here a exemple of what i but normally in my program:

    gluPerspective(45.0f,(GLfloat)Width/(GLfloat)Height,0.1f,100.0f);

    Width and Height are the Width and Height of my window.

    Here a reference to this function:

    void gluPerspective(GLdouble fovy,
    GLdouble aspect,
    GLdouble zNear,
    GLdouble zFar)
    PARAMETERS
    fovy
    Specifies the field of view angle, in degrees, in the y direction.

    aspect
    Specifies the aspect ratio that determines the field of view in the x direction. The aspect ratio is the ratio of x (width) to y (height).

    zNear
    Specifies the distance from the viewer to the near clipping plane (always positive).

    zFar
    Specifies the distance from the viewer to the far clipping plane (always positive).

    Hope it's help you!

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    chicoutimi canada (quebec)
    Posts
    10

    Re: Perspective

    I know all that but it doesn't work, I define my gluperspective on an older version where the lightning system was not enabled (i use glcolor3d, and glortho) and i just replace glortho by gluperspective and it work just fine. When i try on my final version it sucks a lot even if i don't init my lightning it s a very weird bug i think or i forgot a fondamental fucntion anyone have an idea?!!

  7. #7
    Senior Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    Re: Perspective

    the zNear MUST NEVER be 0, if you want it close to 0 you 0.1 :

    the reason is : zNear divides some components in the Projection matrix.

Similar Threads

  1. Draw texture without perspective on mesh with perspective depth
    By Ray1184 in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 10-22-2018, 04:17 AM
  2. Replies: 2
    Last Post: 06-06-2015, 07:35 AM
  3. Replies: 3
    Last Post: 01-25-2015, 12:27 PM
  4. changing from perspective to ortho back to perspective
    By crappy04 in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-19-2001, 09:03 AM
  5. Perspective -> Orthographic -> Perspective. Textures die!!?
    By Lucretia in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 10-23-2000, 02:19 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