Sign in to follow this  

Relative Camera Like Mario64

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

Greetings! I was wondering are there any tutorial with mathematical functions or even better with D3DX code how to create relative camera movement like in Mario 64? I would like a 3D person view like Tomb Raider but the player should not rotate but when you say right he runs right on the screen at once regardless of the camera direction. Thank you in advance for any kind of tip.

Share this post


Link to post
Share on other sites
Hallo,

If I understand you correctly, what you're talking about is directional control, where as good ole' Lara "Truck" Croft used rotational control ;O)

If you've already got your camera stuff set up, then its more or less just a case of creating a direction vector from the pad input (or keyboard...whatever) and then rotating this by your camera's world Y rotation. So effectively making the input control relative to the camera orientation.

So which ever way the camera is facing, if you press right say, you're creating a heading vector along the X axis ideally...and then rotating this by whatever the cameras world Y is will take that vector in the X axis and turn it into a vector in the camera's X axis, or "Camera space X". Does that make sense...I tend to babble my way through explanation :op

Of course you'll have to handle orientating the character too so if they're facing "left" and you hit "right" they'll either have to snap round some way or more likely rotate about their Y axis until they're facing the new heading vector's direction. you can just interpolate their rotation over 1/4 of a second...or something, whatever looks right. Perhaps doing the rotation before you start their actual movement along the new heading. Experimentaion and tweaking is the key when you get the basics working. Mario turns very quickly which give him the fast snappy Mario feeling, which I like very much.

Sorry I've no links and I've no code in front of me at the moment that I can post, but hopefully thats given you at least an idea how you could do it

GCoder

Share this post


Link to post
Share on other sites

This topic is 4339 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this