Skip to main content
gamedev.net
🔒 Locked

Normal Question?

Started by Chris1066 1 reply 600+ views
Original Post
Chris1066
Chris1066
I have a triangle, whos coordinates are [2,0,0] [0,2,0] [0,0,2] and when I make a face normal for this triangle I get [0.577,0.577,0.577] as expected. The face is at an angle of 45 degrees to the local axis, but if I do a dotproduct of the face normal with the vector [0,1,0] I will get an angle of 54.7 degrees instead of 45, where am I going wrong. Chris
Spellbound
Spellbound
The error that you''re making is that you''re assuming that the triangle is at an angle of 45 degrees to the local axis. It is in fact 54.7 degrees as you have calculated with the dotproduct.

If you rotate the triangle 45 degrees around the y-axis you''ll get these coordinates [1.414,0,1.414][0,2,0][-1.414,0,1.414]. The normal to the triangle is now [0,0.577,0.816].

I hope you see your error now.
evaclear
evaclear
Just wanted to point out you shouldn''t use degrees in your programs. Everything should be converted into radians, makes life alot easier.
Joseph FernaldSoftware EngineerRed Storm Entertainment.------------------------The opinions expressed are that of the person postingand not that of Red Storm Entertainment.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.