User Tools

Site Tools


tutorials:leaf-triangulation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
tutorials:leaf-triangulation [2024/12/09 21:39] – added leaf3d stuff MHtutorials:leaf-triangulation [2024/12/09 21:51] (current) – changed some minors MH
Line 65: Line 65:
 </code> </code>
  
- +Coming back to the //PolygonMesh// version, the //Library// function //getMesh// takes a //FloatList// of triangulated points and does the whole conversion to //PolygonMesh// and //MeshNode// for us.
-The //Library// function //getMesh// takes a //FloatList// of triangulated points and does the whole conversion to //PolygonMesh// and //MeshNode// for us.+
  
 <code java> <code java>
Line 137: Line 136:
 }); });
  
-const PolygonMesh polygonMesh = new PolygonMesh();+static MeshNode LeafletMesh;
 static { static {
-    int[] tmp new int[vertexDataLeaflet.size()/3]; +    LeafletMesh getMesh(vertexDataLeaflet);
-    for(int i = 0; i<tmp.length; i++) tmp[i]=i; +
-    // set a list of the indices of the used list of vertices +
-    // normally = {0,1,2,3,...,n}, where n is the number of used vertices minus one  +
-    polygonMesh.setIndexData(new IntList(tmp)); +
-    // set the list of vertices +
-    polygonMesh.setVertexData(vertexDataLeaflet);+
 } }
  
 protected void init() [ protected void init() [
-    Axiom ==> Scale(0.07, 0.07, 0.01)  MeshNode.(setPolygons(polygonMesh), setShader(GREEN)); +    Axiom ==> Scale(0.07, 0.07, 0.01) LeafletMesh.(setShader(GREEN)); 
 ] ]
 </code> </code>
Line 176: Line 169:
 <code java> <code java>
 protected void init() [ protected void init() [
-  Axiom ==>  +  Axiom ==> 
-    +    for(int i=0; i<DEFAULT_LEAF3D.length; i++) ( 
-      for(int i=0; i<DEFAULT_LEAF3D.length; i++) ( +      [ Null(i*0.3,0,0) leaf3d(i) ] 
-        [ Null(i*0.3,0,0) leaf3d(i) ] +    )
-      ) +
-    ]+
 ] ]
 </code> </code>
Line 187: Line 178:
 The predefined 3D leaf shapes will look as shown below: The predefined 3D leaf shapes will look as shown below:
  
-{{ :tutorials:leaf3d.png?direct&600 |}}+{{ :tutorials:leaf3d.png?direct&625 |}}
  
  
tutorials/leaf-triangulation.1733776778.txt.gz · Last modified: 2024/12/09 21:39 by MH