?
Solved

Rotate object to sit on a plane.

Posted on 2003-10-30
4
Medium Priority
?
358 Views
Last Modified: 2013-12-08
What i need to do is to rotate an object - car - so that it sits on my terain.

I can obtain a Normal vector which is the up vector for the object but i do not know how i can take this normal and turn it into the angles i need to rotate the car.

In doing this, i also need to include a direction for which my model should be facing in the world.

Thankyou for any help and ideas.
0
Comment
Question by:crogookah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:anandhir
ID: 9745530
Hi,
I'm having the same doubt can anyone  pls help me with some ideas of how to & what to do.
Thank u for any help.
0
 

Accepted Solution

by:
F4Codec earned 375 total points
ID: 9746982
I think you can do this with the dot product.

You will need, a normal for your particular bit of terrain. If its flat, then this is pointing straight up, not flat and it will be pointing in some other direction.
Now - if you use the dot product equation ->
A DOT B = cos angle
then you can see a dot product of the straight up vector and your normal will give you cosine of the angle.
This will be 1 if they are identical, 0 if perpendicular, -1 if opposite and various intermediate values in between.

So - the angle that you are tilted at is arccos(TerrainNormal DOT UpUnitVector)

Do this twice for roll and pitch, yaw is up to your driver!

0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month9 days, 16 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question