simple question

Started by
0 comments, last by diego_rodriguez 22 years, 8 months ago
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!
Advertisement
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

This topic is closed to new replies.

Advertisement