Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
|
ghast [2014/12/01 18:19] niak créée |
ghast [2017/09/28 15:44] (Version actuelle) |
||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | {{:ghast.jpg?nolink&200|}} | ||
| + | |||
| Voici le code pour un ghast : | Voici le code pour un ghast : | ||
| Ligne 4: | Ligne 6: | ||
| function main(){ | function main(){ | ||
| + | return tout().scale([1.5,1.5,1.5]); | ||
| + | } | ||
| + | |||
| + | function tout(){ | ||
| return difference (corps(), | return difference (corps(), | ||
| visage()); | visage()); | ||
| } | } | ||
| + | |||
| function corps(){ | function corps(){ | ||
| return union (ventre(), | return union (ventre(), | ||
| - | pieds().rotateX([-15])); | + | pieds().rotateX([-15])). |
| + | subtract(cube_bas()); | ||
| } | } | ||
| + | |||
| function ventre(){ | function ventre(){ | ||
| return cube ({size:[15,15,15]}); | return cube ({size:[15,15,15]}); | ||
| } | } | ||
| + | |||
| function pieds_devant(){ | function pieds_devant(){ | ||
| - | return union (cube({size:[2,2,10]}).translate([1,-1,14]), | + | return union (cube({size:[2,2,11]}).translate([1,-1,14]), |
| - | union (cube({size:[2,2,10]}).translate([5,1,14]), | + | union (cube({size:[2,2,11]}).translate([6,-0.5,14]), |
| - | cube({size:[2,2,10]}).translate([10,0,14]))); | + | cube({size:[2,2,11]}).translate([11,-2,14]))); |
| } | } | ||
| + | |||
| function pieds_derriere(){ | function pieds_derriere(){ | ||
| - | return union (cube({size:[2,2,11]}).translate([1,6,14]), | + | return union (cube({size:[2,2,11]}).translate([1,6,16]), |
| - | union (cube({size:[2,2,11]}).translate([5,7,14]), | + | union (cube({size:[2,2,11]}).translate([6,7,16]), |
| - | cube({size:[2,2,11]}).translate([10,7,14]))); | + | cube({size:[2,2,11]}).translate([11,7,16]))); |
| } | } | ||
| + | |||
| function pieds(){ | function pieds(){ | ||
| return union(pieds_derriere(), | return union(pieds_derriere(), | ||
| pieds_devant()); | pieds_devant()); | ||
| } | } | ||
| + | |||
| function visage(){ | function visage(){ | ||
| return union (cube ({size:[4,1,1]}).translate([2,0,5]), | return union (cube ({size:[4,1,1]}).translate([2,0,5]), | ||
| union (cube ({size:[4,1,1]}).translate([9,0,5]), | union (cube ({size:[4,1,1]}).translate([9,0,5]), | ||
| cube ({size:[4,1,1]}).translate([5.5,0,10]))); | cube ({size:[4,1,1]}).translate([5.5,0,10]))); | ||
| - | }</code> | + | } |
| + | |||
| + | function cube_bas(){ | ||
| + | return cube({size:[20,20,5]}).translate([0,0,23]); | ||
| + | } | ||
| + | |||
| + | ghast = main; | ||
| + | </code> | ||