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

Thread: can someone please post basic layout please

  1. #1
    Intern Contributor
    Join Date
    Mar 2004
    Location
    UK, Portsmouth
    Posts
    71

    can someone please post basic layout please

    Hi,

    Am new to openGl and am having problems as i dont know where things should go, could someone please post up a basic layout, e.g. where the gluPerspective should be defined. I have the follwoing as a what i use as a start up:
    Code :
    init()
      //initiate any openGL stuff
      glClearColor()
     
    Main()
      //use this to create the window and used for callbacks
      glutCreateWindow()
      glutInit ( &argc, argv )
      init()
      glutKeyboardFunc(keyPressfunc);
      glutMainLoop ();
     
    keyPressFunc()
      /use this to listen to key presses
    The main thing that i am looking for is where should i put the gluPerspective and the gluLookAt as these are what i am using, jhave tried the init and display functions but changing the values dont do anything.

    Cheers

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

    Re: can someone please post basic layout please

    Hi !

    glut comes with lots of small nice example applications, the easiest thing is to look at them.

    Mikael

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,096

    Re: can someone please post basic layout please

    I have a basic GLUT layout on my website: www.angelfire.com/linux/nexusone/

    As for using perspective and glulookat, they are used to setup how openGL looks at the 3D world.
    I think you need to do a more of the nehe tutors and download or buy a copy the openGL red book.
    There is a link for a PDF version of the red book under documetation on this website, it will explain setting up your views using perspective and ortho.

Posting Permissions

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