Page 1 of 1

Setting node perpendicular to polygon

Posted: Thu May 04, 2006 1:26 pm
by $L!M
I need to set my node perpendicular to triangle. I have a triangle, so i can get it normal. But i don't know how I can place my object to be perpendicular to triangle. I hope you understood me.
Sorry for my awfull english.

Posted: Fri May 05, 2006 6:04 am
by $L!M
Maybe you can't understand my question? I'll make a picture now. %)

Few minutes later ))
Here it is:
Image
Green tube shows general position. And red one shows how i need to place the tube (SceneNode).

I hope you'll help me :roll: .

Posted: Fri May 05, 2006 12:07 pm
by Spintz
This is similar to methods used for decal nodes -

http://www.gamedev.net/reference/articl ... le1986.asp

You need to get the plane normal of the triangle you are placing the scene node on and use that for rotation. It's really not as simple as you make it out to be, what happens if the object is not setting entirely on a single triangle?

Research that stuff a bit and if you still need help, ask for more information.

Posted: Fri May 05, 2006 12:52 pm
by $L!M
Thnx for answer. I'll read this article.
Spintz wrote:what happens if the object is not setting entirely on a single triangle?
Averaged normal. :idea: