Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Torquai

3D movement (should be easy)

This topic is 5777 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

I am trying to make a camera move in all possible directions (Like any space simulator), but I can''t seem to get the hang of it. I know (at least I think I do) that I could (should?) pretend a ray and just move a certain distance (speed) on that ray. And the formula for finding a point on a ray is: PointOnRay = Raystart+speed*RayDirection The problem is finding what values goes into RayDirection, is it values from 0-1 (0-360 degrees) or another weird set of values? And if anyone know a better way to do this (and can explain good since I am a total newbie at writing 3D games) Thanks in advance -Thomas Leggett tl@removeme@digitalteknikk.no

Share this post


Link to post
Share on other sites
Advertisement
Before you go jumping into a free for all camera I suggest that you try something else first but Im not here to stop you from doing things im here to help so here it is,

I personally prefere storing a camera as 2 vectors 1 pointing up above the person, and one pointing Towards the thing that camera is looking at, and a simple Point holding the cameras position you then rotate these vectors to change the orintation of the camera and you add or subtract to the Postion of the camera by changing the location varible. Then When your all ready to go on to drawing your scene you can make a camera matrix and a translation matrix from this simple set of data and use it to setup your camera in what ever 3d API you use. If you use OpenGL you can use GluLookAt(); with your data very easily because you have all the data you need to suppiele it. Im not sure about D3d because I have never used it.

Keep in mind there might be a better way but I find this very simple and easy to ues as long as you have a decent knowlege of Vectors, matrixs, and rotation.

(EDIT) Typos

[edited by - Xero-X2 on January 23, 2003 6:46:44 PM]

Share this post


Link to post
Share on other sites

  • 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!