Results 1 to 6 of 6

Thread: Automatic Tour (camera question)

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2008
    Posts
    6

    Automatic Tour (camera question)

    I have a 3D football field that I have developed and the user is allowed to move the camera freely throughout the scene. By using the keyboard and pressing letters such as 'a' or 's', it will update my lookAt function and will allow the camera to move through the scene. I have this working fine and is not the problem. The problem is that I want to create an "Automatic Tour" through my scene. For instance to change the camera position to around 3 or 4 different positions to show off some different views. I would like the user to press the letter 'k' and this tour happen. However, I cannot figure out a good way to accomplish this. I have tried updating my lookx, looky, and lookz variables which in turn are used by glLookAt(lookx,looky,lookz,.....); But it goes so fast that it seems I am only doing 1 view. Does anyone have any recommendations on how to accomplish the feeling of an automatic tour (the camera moving through the scene on its own). Thanks in advance!!

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2008
    Posts
    6

    Re: Automatic Tour (camera question)

    Is this question not clear or are there no recommendations? Thanks.

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    990

    Re: Automatic Tour (camera question)

    Maybe you need to add some timer functions to make the speed of your movement independent of the frames per second so that it moves equally fast on slow and fast machines.

  4. #4
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,931

    Re: Automatic Tour (camera question)

    Basic solution: program your camera transformation as a function of time. This way you will get same animation speed on every machine.

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2008
    Posts
    6

    Re: Automatic Tour (camera question)

    Quote Originally Posted by Zengar
    Basic solution: program your camera transformation as a function of time. This way you will get same animation speed on every machine.
    How do I go about doing this??

  6. #6
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,931

    Re: Automatic Tour (camera question)

    Well, you can define a path along which your camera moves (for example, as a curve or a set of lines). Then, if you have the velocity, you can determine the camera position in a particular time point. The camera direction is pointed towards the path. I am sure you will figure it out from now on, this shouldn't be that hard. I would gladly supply you with some code, but I have never done anything like that ; as a matter of fact it has been some years since I last worked with 3d graphics...

Similar Threads

  1. Automatic TexCoord Generation question
    By Mars_999 in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 12-29-2006, 11:17 AM
  2. A camera question.
    By lgc_ustc in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-02-2004, 05:27 AM
  3. Replies: 3
    Last Post: 12-08-2002, 11:13 PM
  4. Camera Question
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-02-2002, 12:55 PM
  5. question about camera
    By MrShoe in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-31-2001, 12:13 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