CodeBase - Mouse Controlled Camera Rotation

Return to the CodeBase listing

Category: Camera

Version: 1.0

0
0

Information

Uploaded: 4th May 2009 18:02

Modified: 1st Jan 1970 01:00

Author:  300happy

Summary

Allows positioning the camera around a 3d point, using mouseXYZ to control rotation, angle, and zoom. Limits Y rotation to prevent going over 90 degrees. Z is also limited to zooming between min and max values. If you've ever played games like Prince of Persia or Assassin's Creed, this will feel very familar to you.

Full Description

This is some pretty simple code, but I spent the afternoon making it as I'm learning DBPro, and thought I would share it since I couldn't find a plain, simple example of doing this.<br /> <br /> What this code does:<br /> <br /> Allows positioning the camera around a 3d point, using mouseXYZ to control rotation, angle, and zoom. Limits Y rotation to prevent going over 90 degrees. Z is also limited to zooming between min and max values.<br /> <br /> If you've ever played games like Prince of Persia or Assassin's Creed, this will feel very familar to you. <br /> <br /> Should be easy enough to add to your own project, and is as well commented as I could come up with.

Comments

No comments yet.