Results 1 to 3 of 3

Thread: Trailing camera

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    4

    Trailing camera

    I am writing a driving game, but cant make the 'camera' work. Can somebody tell me how
    to create a 'trailing' camera view. I've tried storing the cars position in an array then use that in glulookat, but the view just swingsabout all over the place!

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Location
    .dk
    Posts
    134

    Re: Trailing camera

    How about

    Code :
    camera.interest = car.pos;
    camera.position  = car.pos + distance*(global.up-car.current_drive_direction);
    - assuming up and car.direction are normalized. This would result in a locked view - you probably want a smoother result, but I guess it'll get you started.

    \\hornet

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2005
    Posts
    4

    Re: Trailing camera

    many thanx - probably posted that in the wrong section - really a beginners problem i suppose. I always struggle with views for some reason

Similar Threads

  1. [Camera] Can't make the camera move appropriately
    By onion_bread in forum OpenGL ES
    Replies: 0
    Last Post: 12-01-2011, 07:36 PM
  2. Camera Position / Camera Angle / Camera Target Position
    By bobGL in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-02-2007, 09:28 AM
  3. Trailing problem
    By zadeh79 in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 08-23-2006, 02:12 AM
  4. Trailing charachter
    By zadeh79 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 08-20-2006, 09:20 PM
  5. Trailing camera
    By onepint in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-03-2005, 12:06 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