Rendering Normal

Started by
3 comments, last by Shumner 24 years, 1 month ago
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-
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
---Ranok---
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-
yes

Do it like this:

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

Edited by - Spellbound on 3/11/00 6:51:48 AM
Thanks.....I will give it a try.

shumner-

This topic is closed to new replies.

Advertisement