Ci-dessous, les différences entre deux révisions de la page.
ghast [2014/12/01 18:31] niak |
ghast [2017/09/28 15:44] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Voici le code pour un ghast : | ||
- | <code javascript> | ||
- | |||
- | function main(){ | ||
- | return difference (corps(), | ||
- | visage()); | ||
- | } | ||
- | |||
- | function corps(){ | ||
- | return union (ventre(), | ||
- | pieds().rotateX([-15])); | ||
- | } | ||
- | |||
- | function ventre(){ | ||
- | return cube ({size:[15,15,15]}); | ||
- | } | ||
- | |||
- | function pieds_devant(){ | ||
- | return union (cube({size:[2,2,10]}).translate([1,-1,14]), | ||
- | union (cube({size:[2,2,10]}).translate([6,1,14]), | ||
- | cube({size:[2,2,10]}).translate([11,0,14]))); | ||
- | } | ||
- | |||
- | function pieds_derriere(){ | ||
- | return union (cube({size:[2,2,11]}).translate([1,6,14]), | ||
- | union (cube({size:[2,2,11]}).translate([6,7,14]), | ||
- | cube({size:[2,2,11]}).translate([11,7,14]))); | ||
- | } | ||
- | |||
- | function pieds(){ | ||
- | return union(pieds_derriere(), | ||
- | pieds_devant()); | ||
- | } | ||
- | |||
- | function visage(){ | ||
- | return union (cube ({size:[4,1,1]}).translate([2,0,5]), | ||
- | union (cube ({size:[4,1,1]}).translate([9,0,5]), | ||
- | cube ({size:[4,1,1]}).translate([5.5,0,10]))); | ||
- | } | ||
- | }</code> |