Jump to content
  • Advertisement
Sign in to follow this  
dotnetted

Object Movement / Camera System

This topic is 4760 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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. =]

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!