zoukankan      html  css  js  c++  java
  • 【WPF】MeshGeometry3D中的Normals和TextureCoordinates属性

     

    MeshGeometry3DNormals属性和TextureCoordinates属性用于指定纹理如何贴到3D模型的表面去。


    <MeshGeometry3D Positions="1,1,0 -1,1,0 -1,-1,0 1,-1,0"  

                                     Normals="0 0 1, 0 0 1, 0 0 1, 0 0 1"

                                     TextureCoordinates="1 0, 0 0, 0 1, 1 1"

                                     TriangleIndices="0,1,3 3,1,2"/>

    上面的代码建立了一个简单的平面模型。

     

    MSDN:Normal vectors are vectors perpendicular to the face of each triangle that defines a mesh. Normals determine whether a given triangle face is lit.Normals决定了一个给定的三角面是否被照亮)

    MSDN:Texture coordinates determine how a Material is mapped to the vertices of the triangles that make up a mesh. TextureCoordinates决定了材质如何被映射到构成网格的三角形的顶点)


    对于一个材质来说,它的顶点定义如下:

     

    上面的代码: TextureCoordinates="1 0, 0 0, 0 1, 1 1"也就是说,将M1映射到P0M0映射到P1M3映射到P2M2映射到P3,即:



    顺便放自己做的一个简单的3D程序

  • 相关阅读:
    WinForm画网格并填充颜色
    CodeCombat最后一题GridMancer
    TeeChart缩放
    TeeChart的网络资料
    TeeChart设置图表的标题
    TeeChart取消3D
    TeeChart的坐标轴
    TeeChart入门
    win7下配置IIS
    C#中的编译开关
  • 原文地址:https://www.cnblogs.com/RMay/p/1232287.html
Copyright © 2011-2022 走看看