3D movement (should be easy)
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
-Thomas LøvlieSemi-Pro Delphi Developer
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]
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]
"I seek knowledge and to help those who also seek it"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement