Character Movement
Hi all. I have a 3d object and am able to rotate it and move forward and backwards. But, what I want to do is when the character rotates, say 45 degrees to the left the character will move forward (left on the screen). Currently when "moving forward" the character always moves in and out of the screen.
Thanks
Let me explain a bit more.
I have loaded and drawn to the screen a character. I have set the left and right arrow keys to rotating the character, left array rotates left from character view, right -- right. I also have the up arrow button set to moving the character out of the screen... which is kind of what I want. But say the character rotates 25 degress to the right and then they move forward. They are still moving in and out of the screen, not 25 degrees to the right - in and out. How can I implement that kind of motion?
Thanks
I have loaded and drawn to the screen a character. I have set the left and right arrow keys to rotating the character, left array rotates left from character view, right -- right. I also have the up arrow button set to moving the character out of the screen... which is kind of what I want. But say the character rotates 25 degress to the right and then they move forward. They are still moving in and out of the screen, not 25 degrees to the right - in and out. How can I implement that kind of motion?
Thanks
Are you in 3d? cause if you are you have to use the characters matrix. and move based on the matrix of your player.
Are you in 3d? cause if you are you have to use the characters matrix. and move based on the matrix of your player.
Yes, I''m using opengl and displaylists to display my character in different positions. I know this isn''t a good way of doing things.. but I''m just experimenting. How can I get the character to move differently than just in and out and right and left?
thanks
thanks
You need to keep around a vector that points in the direction the character is facing, then instead of just adding a position to the x (or y or z) OnUpArrow, you project the movement along the character''s facing vector (the one that goes in RotateWorld()) and add that to the characters center point (the one that goes in TranslateWorld().
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement