0
votes

I have an object that I wish to be parallel to a plane. The object needs to rotate on the yaw axis while remaining parallel to the plane. Having the normal of the plane and a yaw value, how can I compute the pitch and roll values for the object?

To be less general, I have a car model resting on a plane. When the player looks around, I need to update the rotation of the model, namely the Pitch and Roll, so that the models remains aligned to that plane.

1
what have you tried and what is your context? Please click edit to revise your question. - nicholaswmin

1 Answers

0
votes

I can't give you a precise answer for your question but I do think I know how to get you somewhere. Your car is an object that has 3 rotational axes: pitch, yaw, and roll. The road (that is our plane) has the same axes. If i understand you correctly, then

  1. You need to get the yaw of the road and use it in the rotation of your car
  2. Ignore yaw in your rotation (but I can't know the details of your situation)

If all this fails you can

  1. Try and find the code that UDK uses for their vehicles and maybe work from there. I know that epic as a lot of sweet code if you look for it. a program called uncode x can help you there
  2. Or buy "Unreal Development Kit Game Programming with Unrealscript: Beginner's Guide" by Rachel Cordone. It is really helpful and explains a lot, including how to manipulate rotation.