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

Thread: zooming - with glulookat()?

Threaded View

  1. #1
    Newbie Newbie
    Join Date
    Jun 2013
    Posts
    3

    zooming - with glulookat()?

    hi guys,

    i've read several posts and tutorials regarding zooming in opengl now and yet i am still not able to get it to work.
    what i have: left bottom corner is at (-1, -1), right top corner is at (1, 1), and my code draws some simple GL_POINTS (all of them at z = 0); my canvas dimensions are (1024, 768).
    what i want to do: a simple zoom by a defined factor.

    currently i'm trying this approach, i have trouble understand which argument values to use though. if i try it like this, i see only the background color after a repaint.

    my code right now:
    Code :
    	zoom -= 0.1;
    	glMatrixMode(GL_PROJECTION);
    	glLoadIdentity();
    	gluPerspective (zoom, 1024 / 768, 1, 3); 
     
    	glMatrixMode(GL_MODELVIEW);
    	glLoadIdentity();
    	gluLookAt(0, 0, 0, 0, 0, 0, 0, 1, -1); // eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz


    what is the easiest way achieve this?

    thanks :-)
    Last edited by rebal_; 06-20-2013 at 07:20 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
  •