您的位置:首页 > 其它

Coordinate System and Geometry-1

2007-05-13 14:19 369 查看
3-D Coordinate system:

Left-handed and Right-handed Coordinates

左手系和右手系



In DirectX,we use left-handed coordinate.

在DirectX中,采用左手系。

Face and Vertex Normal Vector:

Each face in a mesh has a perpendicular normal vector.The face normal points away from the front side of the face.The front face is one in which vertices are defined in clockwise order.Usually,the front face is visible and the back face are not shading.

纹理中每个面都有一个垂直的法向量。面法向量的方向背离该平面。一个面分为前后两侧面,前指面的顶点按顺时针方向排列的侧面。一般的渲染中只渲染每个平面的前面。

Direct3D uses the vertex normals for Gourand shading,lighting,and texturing effects.When applying Gourand shading to a polygon,Direct3D uses the vertex normals to calculate the angle between the light source and the surface.Direct3D calculates the light intensity value by using the angle.The greater the angle,the less light is shining on the surface.

Direct3D使用顶点法向量来实现Gourand 渲染,光照和纹理效果。当用Gourand渲染一个多边形时,Direct3D使用顶点法向量来计算光源和表面的角度。用这个角度来决定光的强度。角度越大,照到这个表面的光线越弱。

If you are creating an object that is flat,set the vertex normals to point perpendicular to the surface.

如果物体的表面是平的,那么每个顶点的法向量都垂直于表面。

If your object is made up of triangle strips and the triangles are not coplanar.One simple way to achieve smooth shading across all the triangles in the strip is to first calculate the surface normal vector for each polygonal face with which the vertex is associated.The vertex normal can be set to make an equal angle with each surface normal.

如果物体是由triangle strips组成,并且三角形不共面,一个实现平滑渲染的方法是:现计算出每个面的法向量,然后顶点的法向量与关联面的法向量夹角相等。如下图:



If the vertex normal leans toward one of the faces with which is associated,it causes the light intensity to increase or decrease for points on that surface,depending on the angle it makes with the light source.

如果顶点法向量倾向与之关联的面,它将回改变对应面的光照强度。如下图S1面的光强因夹角的变小而增大:



Also we can made the edge sharp by duplicating the vertex normal vectors at any intersection of faces.

同样我们也可以通过加倍顶点法向量来锐化边界。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: