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

  • 相关阅读:
    Js 之获取QueryString的几种方法
    Go语言 之md5加密
    跨域取文件(跨项目)
    System.IO
    System.Threading.Tasks
    JS存取Cookies值,附自己写的获取cookies的一个方法
    HttpServerUtility 和 HttpUyility
    JS格式化时间
    JS获取页面传过来的值
    Navigator 对象
  • 原文地址:https://www.cnblogs.com/RMay/p/1232287.html
Copyright © 2011-2022 走看看