Results 1 to 7 of 7

Thread: Rotating the camera

  1. #1
    Member Newbie
    Join Date
    Aug 2009
    Location
    Iran, Mashhad
    Posts
    41

    Rotating the camera

    Hi people

    How can I rotate a camera to look around the scene?

    I checked some complicated tutorials which they made me so much confused.

    I would be appreciated if you could show me the way as simple as possible.

    Thanx

    P.S: I use Microsoft Visual c++ 2008

  2. #2
    Member Newbie
    Join Date
    Aug 2009
    Location
    Iran, Mashhad
    Posts
    41

    Re: Rotating the camera

    well, Still your comments are welcome guys .....

  3. #3
    Senior Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    171

    Re: Rotating the camera

    some times talking
    i don't understand P.S.
    if you are looking for camera which like ghost(go through wall)
    then:
    1. download mesa3D demos library
    2. Clear that you have following libraries
    a.related to OpenGL(link library with dll/so)
    b.related to glut32(link library with dll/so)
    c.related toglu32(link library with dll/so)
    3. any of the demos containing gluLookAt function
    understand the ObjPos function
    4. make your own source with following precaution

    i) don't use glLoadIdentity(); and glMatrixMode(GL_PROJECTION); in your draw function(it might used for 2Dness I stuck with that for 2 months and no one correctly regard to that and need to understand by my self
    i read mesa codes 50 times to get it)
    ii) your resize function must contains glLoadidentity(); after first glMatrixMode();
    iii)LookAt must under
    PushMatrix();
    */Lookat*/
    PushMatrix();
    PopMatrix();
    PopMatrix();

    At Last the body of code should be
    Code :
    // at just looking it you may not understand but after done it
    // u find setting camera is of just few punch code...
    //include the neccessary things gl,glu,glut
     
    draw()
    {
    Clear
    ClearColor
    PushMatrix
    camramath
    LookAt(with cameramath variables);
    PushMatrix
    draw the things
    PopMatrix
    PopMatrix
    }
    resize(int ,int)
    {
    //...read_mesa_code//
    }
    key+Skey()
    {
    //....read_mesa_code for Angles/moves
    }
    main()
    {
    //u know that
     
    DisplayFunc(draw);
    ReshapeFunc(resize);
    KeyboardFunc(key);
    MainLoop();
    }
    //I hope you read any of Mesa's demos Code so undrstand the text
    watch at
    The Industry's Foundation for High Performance Graphics
    watch at a text box above the
    Graphics(specially above phics)
    it used for search word "word in box"
    lis in whole opengl.org site
    so you find the thread:- "camera"
    haven't made a game [img]<<GRAEMLIN_URL>>/frown.gif[/img]

  4. #4
    Member Newbie
    Join Date
    Aug 2009
    Location
    Iran, Mashhad
    Posts
    41

    Re: Rotating the camera

    Thanx vivek vyas

    I also look for some explanations on math related things...

    any comments would be appreciated

  5. #5
    Senior Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    171

    Re: Rotating the camera

    have you installed demos at first
    anyway it is trignometric maths just three lines needed but works much i had programmed some my self demos with png images
    haven't made a game [img]<<GRAEMLIN_URL>>/frown.gif[/img]

  6. #6
    Member Newbie
    Join Date
    Aug 2009
    Location
    Iran, Mashhad
    Posts
    41

    Re: Rotating the camera

    Well ...
    I Can work with OpenGL functions a little. I just don't know about the maths basics like Camera transformations.

    The exact thing I want to know is like First Person Shooter games. When I push the left arrow kew, the camera rotates to left around Y Axis and when I push the right arrow key, vise versa.

  7. #7
    Senior Member Regular Contributor
    Join Date
    Apr 2009
    Posts
    171

    Re: Rotating the camera

    no read demos Mesa lies on sf.net
    and in progs/demos/tunnel.c
    found calcobjpos
    then see at what places it use and then mimic it.
    if compile tunnel.c
    u find it is look like FPS(my mean someone goes through tunnel)
    haven't made a game [img]<<GRAEMLIN_URL>>/frown.gif[/img]

Similar Threads

  1. Rotating camera in 4pi.
    By brambilla in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-25-2009, 07:05 AM
  2. rotating a camera around a point.
    By seckley in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 08-03-2007, 11:33 AM
  3. Camera rotating
    By Vlasko in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-13-2004, 10:48 AM
  4. rotating and moving camera for FPS
    By El in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-20-2004, 05:36 PM
  5. rotating and moving camera for FPS
    By El in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 01-19-2004, 12:34 PM

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