#### Archived

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

# Normals for 3D Cone

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

## Recommended Posts

im working on function that create a 3D Cone . it uses triangles that share one point , that point have a diffrent y value. now , how do i calculate the normal for each triangle???? beacause the light(im using diractional light) is lighting all the triangles in the same power, so it not looks a 3d cone..... any iseas for calculate the normals ??? Posted By Xeno. Kobe Bryant - "Just believe in yourself"

##### Share on other sites
The normals be set to the following values:

x = Height*cos(angle)/l;
z = Height*sin(angle)/l;

The angle is the same angle you use to produce the vertex pos.

Now for the top vertex. Because you are using gouraud shading, that is not flat shading, the top vertex cannot be shared among the triangles. You''ll need one vertex per triangle, these vertices should have the same normal as the one directly below in the base.

##### Share on other sites
first - "wow , how did u think about that!"

it look like it need to work but it working just on something like half of all the triangles.

and yes every trinagle have its own top vertex, they dont really share the top vertex.

but i dont understand how to apply the normal for the top vertex, what do u mean that the top vertex should have the same normal as the one directly below in the base?

Thanks a lot.
its very help.

Posted By Xeno.
Kobe Bryant - "Just believe in yourself"

##### Share on other sites
I recognized that the normals have the same angle to the ground plane as the cone''s side have to the cone''s axis. If you draw it on paper you can easily see this. Plus I know my math.

Hmm, maybe I don''t know my math, I just spotted an error in the formulas. They should be

The normal for the top vertex of a triangle has the same angle against the ground plane as the two vertices in the cone''s base. Now that I have more time to think about it you should compute the normal with the middle angle like this:

Here AngleStep is the angle between each of the vertices in the base.

This should work for all triangle, not just half.

- WitchLord

##### Share on other sites
it still dont work , seems that i dont really understand it.
hmmm.... can i post here the code that create the cone, and u will check it??

Posted By Xeno.
Kobe Bryant - "Just believe in yourself"

• 10
• 34
• 29
• 9
• 15