Jump to content
  • Advertisement

Archived

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

Shumner

Rendering Normal

This topic is 6648 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all. I am looking for an explaination of how to render a normal for a polygon in 3D using OpenGL. Specifically I have my 3D normals calculated for a polygon/plane, but I want to be able to draw a 3d line to display it to visually make sure it is correct. Source code would be appreciated shumner-

Share this post


Link to post
Share on other sites
Advertisement
I am not sure if this would work but...

You could just find the point that is the center of you plane/polygon and then use the normal vector to find where the second point is (ie. where the vector is pointing) and use these two points to draw a 3D line

Share this post


Link to post
Share on other sites
Thanks for the quick reply to my post. I appreciate it.

OK, I can find the center of the triangle ( already wrote that code just in case it popped up )

Now, how would I directly determine the direction the normal is pointing to derive teh second point ( figuring that the line should have length of 5 to 10 units.

Could I just do a sum of the center coordinate location nd the normal vector to get the 2nd point? Then just scale it by the length I want?

shumner-

Share this post


Link to post
Share on other sites
yes

Do it like this:

First point = center
Second point = center + scale * normal

Edited by - Spellbound on 3/11/00 6:51:48 AM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!