Smooth cone normals

后端 未结 2 930
予麋鹿
予麋鹿 2021-01-16 08:17

I\'m trying to calculate smooth normals for a cone. In looking around for code samples and explanations, I consistently come across directions for face normals. I\'ve posted

相关标签:
2条回答
  • 2021-01-16 08:39

    At any point on the surface of a cone except the apex, there are two obvious kinds of tangent vectors: one tangent to the cross-sectional circle, or one up the slope. If you express the surface as a parametric equation with two parameters, you can get these tangent vectors as the two partial derivatives. Take the cross product of the tangents, and you get a normal vector. The order of the product determines whether the normal points inward or outward. Of course, the bottom face must be handled separately.

    0 讨论(0)
  • 2021-01-16 08:47

    In addition to the answer by JWWalker I'd like to point out, that a vertex is a whole tuple of vector, that among other things includes position and normal. So if you have different normals at a single position, you got there different and multiple vertices.

    In the case of the cone this is important, because the tip of the cone is not one single vertex, but a whole set of them (one tip vertex for each triangle the cone's coat. And then for the base circle you got at each position two vertices, the one for the triangle to the tip, and one for the base surface.

    Both the tip and the edge are discontinuities and hence call for a be drawn using separate vertices.

    0 讨论(0)
提交回复
热议问题