|
-
Nov 12th, 2001, 06:26 AM
#1
Thread Starter
Junior Member
-
Nov 12th, 2001, 07:38 AM
#2
You have to find the angle that you are facing on the XZ plane, and the XY/ZY plane (left/right, and up/down). Then, instead of simple adding a value to the Z camera value, you have to figure out a vector that defines the direction you are looking at, and move along that vector.
Also, If you are using the D3DXMatrixLookAtLH or ..RH functions, you can create a vector by adding (or subtracting, dont remember) the current camera position, and the point it is looking at, normalize that vector, and move along it.
Z.
-
Nov 12th, 2001, 08:14 AM
#3
Hyperactive Member
That's in the realm of 3D game theory.
-
Nov 12th, 2001, 08:49 AM
#4
Thats what he's talking about...
Z.
-
Nov 12th, 2001, 09:17 AM
#5
Hyperactive Member
I know, I just felt like posting.
-
Nov 13th, 2001, 08:39 AM
#6
Thread Starter
Junior Member
-
Nov 13th, 2001, 08:44 AM
#7
Think of it this way. Your object is facing in a certain direction on a circle. If you keep track of this value, you can change this to a look at point:
Code:
.x = cos(facing);
.y = cam.y;
.z = sin(facing);
Where y is in the up direction. That should solve the looking around part. When you move, simply move in the direction you are facing, instead of simply adding 1 to .x, or .z, etc.
Z.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|