Archived

This topic is now archived and is closed to further replies.

diego_rodriguez

simple question

Recommended Posts

i dont know how to rotate a vehicle on a random map based on the surface normal of the triangle where it is located on (also considering the vehicle''s own rotation...) help would be appreciated!

Share this post


Link to post
Share on other sites
Hmmm, off the top of my head you need to take the cross-product of the plane normal & the vehicle orientation vector (ie straight up from the roof). Use the resultant vector in glRotate3f(rx,ry,rz,d) where d is the number of degrees to rotate (ie the number of degrees between the vehicle vector & the plane normal) which you can find using a dot-product.
I dunno if that will work, but it should be a step in the right direction.

Brad

Share this post


Link to post
Share on other sites