Results 1 to 2 of 2

Thread: glViewPort problem

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2002
    Location
    BeiJing,China
    Posts
    6

    glViewPort problem

    I used muti-viewport in my program. my view was use gluPerspective(45.0,aspect,4.0,vfar) code. In my sub-viewport, I wanna to draw a 2D-like background by using
    glBegin(GL_QUADS)
    glVertext3d(x1,y1,0.0);
    glVertext3d(x2,y1,0.0);
    glVertext3d(x2,y2,0.0);
    glVertext3d(x1,y2,0.0);
    glEnd();

    I used gluUnproject(realx1,realy1,0.0,...x1,y1,z1) to get the value of x and y.

    Well,when initially run, it seemed all right.But when I increased the value of vfar,the parameter of gluPerctive,the background of sub viewport suddenlly disappeared.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: glViewPort problem

    Hi !

    Switch to orthographic mode and draw the quad, then you can switch back to perspective mode®so you don't need to mess around with unproject.

    Mikael

Similar Threads

  1. using glViewport
    By richman.feynard in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 08-31-2017, 04:07 AM
  2. glviewport problem
    By Jexxxie in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-06-2010, 11:32 PM
  3. glViewport & how to use it
    By t3jem in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 06-16-2005, 10:09 AM
  4. GLUT & glViewPort problem
    By bleifrei in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 05-12-2003, 12:49 PM
  5. about glViewport
    By tigeryhong in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 02-08-2003, 10:30 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