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程序

  • 相关阅读:
    字符串与字典常用命令
    Python学习之路:字符串常用操作
    Python学习之路:购物车实例
    面试题2017
    c#语法学习
    结构化设计模式-桥接模式
    结构型设计模式-适配器模式
    .Net Cache
    设计模式的六大原则
    uml类图关系
  • 原文地址:https://www.cnblogs.com/RMay/p/1232287.html
Copyright © 2011-2022 走看看