-
Away3d simple third-person camera
Ok I will be point blank about this. I want a following camera in away3d scene that looks at an object.
What I want the aspects of it to be is simple.
I would want it to not move left and right when you click on keys to move left and right. But just stay put and have the character alone move right.
But when you press keys to move forward in backward it moves at the same angle the character moves. Just a typical third person camera. Nothing to hard, Its just that I have been trying to do this for a long time and have yet to figure out how!
For an example of what I want, if you have ever played Jak and Daxter the Precurser Legacy. I want it to be something like that style. Doesn't move left and right. Just forward and backward along the angle it is facing, which would be the direction where your character is.
Can anyone point me out on how I would get this done?, Please someone help!
-
Have your character at a point, move the camera with that point, rotate the camera around that point based on the rotation angle of your character ( basic trig ). Now point the camera at your character.
RipX
-
Originally Posted by RipX
Have your character at a point, move the camera with that point, rotate the camera around that point based on the rotation angle of your character ( basic trig ). Now point the camera at your character.
RipX
For 1:
I don't want to rotate the camera around him, more or less I want him to be user controlled to rotate around the camera. Sort of...
Basically just the ability to have the camera move forward in the same direction the player is going.
For 2:
I don't know that much about the application of trig... Sorta am only a high school sophomore and I haven't taken it.
-
Senior Member
Simply use:
camera.x = player.x;
camera.y = player.y + 50;
camera.z = player.z - 50;
Or something...that should get the camera to move along with the character?
WIP-ZOMBIES
I love vegetarians! More meat for the rest of us!
-
Originally Posted by Pazil
Simply use:
camera.x = player.x;
camera.y = player.y + 50;
camera.z = player.z - 50;
Or something...that should get the camera to move along with the character?
Would have to be more than just that (need both x and z to be calculated with some form of trig equation, other wise it will only follow the player though the z)
-
Senior Member
Then I am really confused at what you are trying to get...You don't want the camera to rotate, but you want it to follow him? That code modifies all 3 axis!
WIP-ZOMBIES
I love vegetarians! More meat for the rest of us!
-
Originally Posted by Pazil
Then I am really confused at what you are trying to get...You don't want the camera to rotate, but you want it to follow him? That code modifies all 3 axis!
I want the camera to look at the player. I want him to move left and right, but the camera doesn't move left and right, just looks at the player. And I want the camera to move forward and backward with the player through the detected angle found between the camera and the player.
The camera only looks at him, and moves forward and backward at the same speed as him. Doesn't move left and right.
-
Originally Posted by cody112
For 1:
I don't want to rotate the camera around him, more or less I want him to be user controlled to rotate around the camera. Sort of...
Then explain better
Basically just the ability to have the camera move forward in the same direction the player is going.
For 2:
I don't know that much about the application of trig... Sorta am only a high school sophomore and I haven't taken it.
Then learn it
RipX
Tags for this Thread
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
|