Welcome to Fractal Forums

Fractal Software => Structure Synth Gallery => Topic started by: barcud on February 15, 2016, 09:41:59 PM




Title: Cube out of triangle pyramids with parameters and tips
Post by: barcud on February 15, 2016, 09:41:59 PM
Triangles are quite underused in Structure synth
They also have a slight problem - depending which way around you define them (corner A->B->C or C->B->A) they are only visible from one side in the openGL preview. The render later on is fine but it gets a bit difficult to see what you are doing.

So what I generally do is
-generate the triangle(s) I want
-use a mirror function (and possibly shift) to create a triangle you can see from both sides
-if it matters you can then - when rendering - half the number of objects by removing the mirrored side

So here a cube made out of triangle pyramids of different heights

Code:
set colorpool image:colori.png 
// creates the 4 sides
4 * {rz 90 x -13} 6 * { z 2} 6 * {x 2} tri3
// and the other two
1 * { rx -90  z -13} 6 * { z 2} 6 * {x 2} tri3
1 * { z 13 rx 90 } 6 * { z 2} 6 * {x 2} tri3

rule tri3{
1 * { y 0.1 s 1 1.2 1} tri2
}
rule tri3{
1 * {y -1  s 1 -1 1}tri2
}
rule tri3{
1 * { y -0.1 s 1 0.8 1}tri2
}
rule tri3{
1 * { y -0.2 s 1 0.6 1}tri2
}

rule tri2{
4 * {ry 90 x 1 color random } triangle[1,0,1;0,1,0;-1,0,1]
}