## Find out the normals

### Find out the normals

When I create an object, say a cylinder made from a triangle fan, is there a
way to extract the normals from each of the vertices (or faces?).

Thanks,
Jon

### Find out the normals

For all three vertices of a given triangle, you can find the common normal
by taking the crossproduct of the two vectors formed by a given vertex and
the other two vertices:  v1 = p1 - p0; v2 = p2 - p0; n = v1 x v2.  For a
smoother looking cylinder, you can take the average of the normals at a
given vertex.

>When I create an object, say a cylinder made from a triangle fan, is there
a
>way to extract the normals from each of the vertices (or faces?).

>Thanks,
>Jon

### Find out the normals

>For all three vertices of a given triangle, you can find the common normal
>by taking the crossproduct of the two vectors formed by a given vertex and
>the other two vertices:  v1 = p1 - p0; v2 = p2 - p0; n = v1 x v2.  For a
>smoother looking cylinder, you can take the average of the normals at a
>given vertex.

>>When I create an object, say a cylinder made from a triangle fan, is there
>a
>>way to extract the normals from each of the vertices (or faces?).

For the special case of a cylinder centered on one of the three coordinate
axes, the surface normal at any given vertex is the vertex, with 0
substituted for the central axis value. (For example, for a cylinder
centered on the Z axis, take the vertex and replace the Z value with zero;
the result is the normal at that vertex.)

You will typically want to make this normal of unit length.

-Paul Martz
Hewlett Packard Workstation Systems Lab

### Find out the normals

Quote:>For the special case of a cylinder centered on one of the three coordinate
>axes, the surface normal at any given vertex is the vertex, with 0
>substituted for the central axis value. (For example, for a cylinder
>centered on the Z axis, take the vertex and replace the Z value with zero;
>the result is the normal at that vertex.)

>You will typically want to make this normal of unit length.

Thank you. I will be needing that information on what I should make the
normals. However, I would like to know a way to find out what the normals
already are for a given figure. Is there a way to query that information?

Jon

### Find out the normals

Quote:>For all three vertices of a given triangle, you can find the common normal
>by taking the crossproduct of the two vectors formed by a given vertex and
>the other two vertices:  v1 = p1 - p0; v2 = p2 - p0; n = v1 x v2.  For a
>smoother looking cylinder, you can take the average of the normals at a
>given vertex.

Thank you. That information on what normal vector I should make will be
quite useful. However, for the moment I need to know a way to query the
existing normals for a given figure.

Jon