Skip to main content
gamedev.net
🔒 Locked

Object Movement / Camera System

Started by dotnetted Oct 10, 2005 at 7:06 PM 1 replies 550+ views
Original Post
dotnetted
dotnetted
Currently, all objects (players, sprites, lighting) have an x, y and z coordinate. The camera moves by "hooking" its xyz vertex with a specific object vertex and mocing with it. Doing it like this seems very restrictive and tedious, is there a more popular way of handling a 3rd person camera while keeping compatible with a generic object class? Any suggestions appreciated. =]
"Scattered fucking showers my ass!" - Noah 4718 B.C
Psychor
Psychor
I'm unsure what advice you're looking for here... if you intend the camera to track an object, you're obviously going to have to move the camera relative to the tracked object's coordinates at some point in your program, although there are different ways you could go about this.

I'm not sure why you're finding it tedious. You could automate the update by having a pointer to the object the camera is tracking in your camera class, and an update function which automatically updates the camera's coordinates based on the tracked object.

If it's the restrictiveness that you're having a problem with, and you're looking to get the camera to move in a more 'interesting' way relative to the object, there are various methods of doing this, but they are all quite math heavy. One popular solution is to represent camera/object rotations as quaternions and use SLERP (Spherical Linear intERPolation) to interpolate between different positions you'd like the camera. You run into all kinds of problems with complex 3rd person cameras however, for example you may need to include tests to make sure your scene objects aren't blocking your view, and reposition the camera accordingly if they are. It's a complex issue, and I don't think I've yet seen any game that handles this perfectly in every concievable situation, though there are some decent solutions out there.
dotnetted
dotnetted
Thanks for the reply, I've decided that I should figure out a list of actions for the cameras first so I have some goals to meet.
"Scattered fucking showers my ass!" - Noah 4718 B.C

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.