• ### What is your GameDev Story?

#### Archived

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

# Rendering Normal

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

## 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 on other sites
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 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 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 on other sites
Thanks.....I will give it a try.

shumner-

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 11
• 13
• 9
• 11
• ### Forum Statistics

• Total Topics
634092
• Total Posts
3015447
×