Ci-dessous, les différences entre deux révisions de la page.
poulpe [2014/12/12 17:01] niak |
poulpe [2017/09/28 15:44] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | ====== Poulpe ====== | ||
- | Voici le code pour une pieuvre : | ||
- | |||
- | <code javascript> | ||
- | |||
- | function main(){ | ||
- | return tout().scale(2,2,2); | ||
- | } | ||
- | |||
- | function tout(){ | ||
- | return corps(). | ||
- | subtract (visage()). | ||
- | union(tentacules()). | ||
- | subtract(bas_plat()); | ||
- | } | ||
- | |||
- | function corps(){ | ||
- | return cube({size:[7,7,10]}).translate([-3,-3]); | ||
- | } | ||
- | |||
- | function visage(){ | ||
- | return cube({size:[1,1,1]}).translate([-2,-3.5,3]). | ||
- | union (cube({size:[1,1,1]}).translate([2,-3.5,3])); | ||
- | } | ||
- | |||
- | function tentacules(){ | ||
- | return cube({size:[1,1,15]}).translate([0,0,8]).rotateX([15]). | ||
- | union(cube({size:[1,1,15]}).translate([0,0,8]).rotateX([-15])). | ||
- | union(cube({size:[1,1,15]}).translate([0,0,8]).rotateY([15])). | ||
- | union(cube({size:[1,1,15]}).translate([0,0,8]).rotateY([-15])). | ||
- | union(cube({size:[1,1,15]}).translate([0,0,8]).rotateX([15]).rotateY([15])). | ||
- | union(cube({size:[1,1,15]}).translate([0,0,8]).rotateX([15]).rotateY([-15])). | ||
- | union(cube({size:[1,1,15]}).translate([0,0,8]).rotateX([-15]).rotateY([15])). | ||
- | union(cube({size:[1,1,15]}).translate([0,0,8]).rotateX([-15]).rotateY([-15])); | ||
- | } | ||
- | |||
- | function bas_plat(){ | ||
- | return cube({size:[25,25,4]}).translate([-10,-10,20]); | ||
- | } | ||
- | |||
- | </code> |