Results 1 to 10 of 11

Thread: Orienting myself in OpenGL

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Orienting myself in OpenGL

    I seem to be having some trouble orienting myself in 3d world, im drawing single objects to get myself use to OpenGL. Though im sure my object are fine and should be drawing, im having trouble to figure where im facing in the world, if you know what im saying. I am fairly new to it all.

    Does anyone got any tips?

  2. #2
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    Have you taken a look at Nehe's tutorials? if you're coming from the 2d world take a look at http://freepascal-meets-sdl.net/ and their 8th lesson since it covers 3d and opengl with opengl.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  3. #3
    yeah i had read through some of the nehe tutorials, i also got the red book 7th edition.
    I just remembered that the red book refers to nate robins suite, that has help me some what.

    Am i right when describing glutLookAt function like this:
    the first 3 cords(eye) define the angle the camera is look at. The next 3 cords(center) define a point that the camera is looking at, and last cords(up) define which way is up?

    Can i assume that you must only use one of:
    glFrustum
    gluPerspective
    glOrtho

    so not to use them in conjunction with each other?

  4. #4
    PGD Staff code_glitch's Avatar
    Join Date
    Oct 2009
    Location
    UK (England, the bigger bit)
    Posts
    933
    Blog Entries
    45
    the glutLookAt bit sounds a tad precarious to me, since from what I have heard glut is quite badly deprecated. Also, I do not see why you cannot use those together... Might I propose a slightly different approach, I would recommend an approach more where you have a program that does something, perhaps in sdl, and then try to break it down and port it to OpenGl so that you understand the program and then how to do it in OpenGl. That way you don't learn a hypothetical understanding of OpenGl but a practical one solving real programming problems...

    Just a thought. I am no OpenGl expert, so I can only suggest not really recommend strongly.
    I once tried to change the world. But they wouldn't give me the source code. Damned evil cunning.

  5. #5
    I meant GluLookAt

    i think thats a good idea on learning the practical side, because the theory stuff is kicking my ass.

  6. #6
    @Code_glitch gluLookAt doesn't belong to glut library It belongs to OpenGL extentions defined in glu unit
    I was confusing that too and started to implement my own camera cause I wanted to get rid of this glut dependancy which turned out to be non-existant

    @MuteClown: The thing with gluLookAt is a bit different compared to your understanding of it. The first 3 parameters in the procedure are defining the position of the "camera" in space. Not the angle. The angle is calculated by procedure based on the position of the camera and point on which the camera is looking.

    You can mix gluOrtho with gluPerspective and even you should in some cases For example, to draw a menu, all the windows and so on, you should switch to gluOrtho, to render 3d objects you switch back to gluPerspective.

    I am beginner with OpenGL but feel free to ask any further questions. Maybe we could help each other

Bookmarks

Posting Permissions

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