144 lines
3.4 KiB
PHP
144 lines
3.4 KiB
PHP
/*
|
|
* H E X A W O O D
|
|
*/
|
|
// =======================================================
|
|
|
|
#declare Hc_ep = 0.42; // epaisseur chassis
|
|
#declare Hc_rad = 0.70; // rayon du chassis
|
|
#declare Hc_elo = 1.85; // elongation sur x
|
|
|
|
// -------------------------------------------------------
|
|
|
|
#macro HW_Un_Cone ()
|
|
merge {
|
|
#local RA = R_basecone * 0.92;
|
|
cone { 0, RA, y*0.91, 0.000001 }
|
|
sphere { 0, RA }
|
|
#undef RA
|
|
}
|
|
#end
|
|
|
|
/* ------------------------------------------------------------ */
|
|
|
|
#macro HW_Cones ()
|
|
union {
|
|
#for (foo, 0, 360, 60)
|
|
#local E = Hc_rad * 0.85;
|
|
#local Tx = Hc_elo * E * sin(radians(foo));
|
|
#local Tz = E * cos(radians(foo));
|
|
object {
|
|
HW_Un_Cone ()
|
|
#if ( rand(Rng1) < 0.5 )
|
|
texture { T_Wood32 rotate 37 scale 1.30 }
|
|
// texture { WIP_color }
|
|
#else
|
|
texture { T_Wood23 rotate x*87 scale 1.33 }
|
|
// texture { T_WIP_alert }
|
|
#end
|
|
// rotate -z*foo
|
|
translate <Tx, Hc_ep - 0.22, Tz>
|
|
}
|
|
#end // end for
|
|
}
|
|
#end
|
|
|
|
/* ------------------------------------------------------------ */
|
|
|
|
#macro HW_Chassis ()
|
|
difference {
|
|
#local El = Hc_elo;
|
|
merge {
|
|
torus { Hc_rad, 0.20 translate y*0.20 }
|
|
cylinder { 0, y*0.40, Hc_rad }
|
|
scale <El, 0.5, 1>
|
|
}
|
|
|
|
/* trou pour mettre une lampe */
|
|
cylinder { -1*y, 0.12*y, 0.08 }
|
|
|
|
torus { Hc_rad*0.30, 0.18 scale <1, 1.45, 1>
|
|
translate y*0.39 }
|
|
|
|
#for (foo, 0, 360, 60)
|
|
#local E = Hc_rad * 0.85;
|
|
#local Tx = El * E * sin(radians(foo));
|
|
#local Tz = E * cos(radians(foo));
|
|
sphere { 0, 0.17 translate <Tx, 0.20, Tz> }
|
|
#local E = Hc_rad * 1.14;
|
|
#local Tx = El * E * sin(radians(foo+30));
|
|
#local Tz = E * cos(radians(foo+30));
|
|
cylinder { -y, y, 0.07 translate <Tx, 0, Tz> }
|
|
#end
|
|
#local R = rand(Rng1);
|
|
#if (R<0.20)
|
|
texture { T_Wood17 rotate <10, 20, 30> scale 0.82 }
|
|
#else
|
|
texture { T_Wood15 rotate <17, 28, 39> scale 1.42 }
|
|
#end
|
|
translate y*0.10 // why ?
|
|
}
|
|
#end
|
|
/* ------------------------------------------------------------ */
|
|
|
|
#macro HW_une_patte ()
|
|
merge {
|
|
/* XXX */
|
|
#local RP = 0.042;
|
|
sphere { 0, RP scale <1, 0.84, 1> translate 0.35*y }
|
|
cylinder { 0, 0.35*y, RP }
|
|
sphere { 0, 0.09 scale <1, 0.29, 1> }
|
|
}
|
|
#local R = rand(Rng1);
|
|
#if ( R < 0.3 ) texture { Tinny_Brass }
|
|
#elseif ( R < 0.8 ) texture { New_Penny }
|
|
#else texture { T_Brass_2C }
|
|
#end // if
|
|
#end // macro
|
|
|
|
/* ------------------------------------------------------------ */
|
|
|
|
#declare HW_les_pattes = object
|
|
{
|
|
union {
|
|
#local E = Hc_rad * 1.14;
|
|
#local El = Hc_elo;
|
|
#for (foo, 0, 360, 60)
|
|
#local Tx = El * E * sin(radians(foo+30));
|
|
#local Tz = E * cos(radians(foo+30));
|
|
object { HW_une_patte () translate <Tx, 0, Tz> }
|
|
#end
|
|
}
|
|
}
|
|
|
|
/* ------------------------------------------------------------ */
|
|
#declare HW_Anneau0 = object
|
|
{
|
|
merge {
|
|
torus { Hc_rad*0.31, 0.0666 scale <1, 0.55, 1> }
|
|
#for (Foo, 0, 359, 60)
|
|
#local DX = Hc_rad*0.31 * sin(radians(Foo));
|
|
#local DZ = Hc_rad*0.31 * cos(radians(Foo));
|
|
#local HC = 0.30 + (0.03*rand(Rng2));
|
|
cone { 0, 0.037, y*HC*1.2, 0.0001 translate <DX, 0, DZ> }
|
|
#end // FOR
|
|
}
|
|
texture { GoldDark }
|
|
rotate y * 65 * Cos_010(NormClock)
|
|
translate y*0.32
|
|
}
|
|
/* ------------------------------------------------------------ */
|
|
#declare HexaWood = object
|
|
{
|
|
union {
|
|
object { HW_Chassis () }
|
|
object { HW_les_pattes }
|
|
#if (mod(clock, 10) < 6)
|
|
light_source { 0.20*y rgb <0, 0.20, 0.95> }
|
|
#end
|
|
object { HW_Cones () translate y*0.15 }
|
|
object { HW_Anneau0 }
|
|
}
|
|
}
|
|
|
|
// =======================================================
|