Search code examples
wpfxaml3dvertexvertices

How can I connect TriangleIndices(a.k.a. Triangles)?


SITUATION

I have this peace of code here for my "3d-mesh"

  <MeshGeometry3D 
       Positions="0 0 0
                  0 1 0  
                  1 0 0  
                  1 1 0"
       TriangleIndices="0 2 1
                        2 3 1" >
  </MeshGeometry3D>

PROBLEM/QUESTION

why i can not use other vertices for creating triangles => i mean whenever i try to write { 0 , 1 , 2 , 2 , 3 , 1} insead of {0 , 2 , 1 , 2 , 3 , 1} i cant see 1st triangle.

EDIT

here are pictures of my examples. (maybe helpful if you want to imagine the situation)

Example 1 : { 0 , 2 , 1 , 2 , 3 , 1}

enter image description here

Example 2 : { 0 , 1 , 2 , 2 , 3 , 1}

enter image description here


Solution

  • The triangle definitions cann't intersect. To be a valid in example 2 the second trianable should be 2,3,0