Thread: Following camera

  1. #1
    Registered User
    Join Date
    Jun 2008
    Posts
    14

    Following camera

    I'm trying to create a game in which there is going to be a bunch of object in one room, or stage. The objects are going have locations outside the room as well as inside. My player will be at the center of the room at all times. When he moves, he still has to be in the center. This means that previously out-of-sight objects will come into sight. I was thinking of changing every single object's coordinates. This can't possibly be practical, as I'm going to have tons of objects such as particles.

    What would be the most efficient way to accomplish this?

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    A camera class that produces a view matrix that is used in the transformation pipeline.

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    70
    Yep. Any app that has a 3d camera will use this method, so if you need example code it won't be hard to find.

  4. #4
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    agreed. There are several on the net.

    http://www.flipcode.com/archives/OpenGL_Camera.shtml
    My Website

    "Circular logic is good because it is."

  5. #5
    Registered User
    Join Date
    Jun 2008
    Posts
    14

    in Allegro

    I'm doing this in Allegro (not Allegro3D or OpenGL), which means that I have a fixed-size bitmap. Thusly, I'm forced to check each and every single object to see if (a) it should be drawn on screen and (b) if it should be, then to calculate its position. Any alternative?

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Then it's not what I would technically call a 'camera.'

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. camera rotation matrix
    By Vick jr in forum Game Programming
    Replies: 5
    Last Post: 05-26-2009, 08:16 AM
  2. LNK2001 ERROR!!! need help
    By lifeafterdeath in forum C++ Programming
    Replies: 7
    Last Post: 05-27-2008, 05:05 PM
  3. Problems moving the camera
    By Mavix in forum Game Programming
    Replies: 8
    Last Post: 01-30-2008, 12:52 PM
  4. RTS camera movement
    By blurrymadness in forum C++ Programming
    Replies: 0
    Last Post: 04-22-2007, 10:37 PM
  5. Camera rotation/movement in 3D world
    By tegwin in forum Game Programming
    Replies: 11
    Last Post: 01-24-2003, 01:43 PM