Solved

Rotate object to sit on a plane.

Posted on 2003-10-30
4
353 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 125 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

749 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