HexaCone/essai.pov
2025-10-19 19:09:46 +02:00

188 lines
3.9 KiB
POVRay

/*
* H E X A C O N E - E S S A I
* nouveau projet du Thu Dec 5 11:37:05 AM UTC 2024
*/
#version 3.7;
#include "globals.inc"
#debug "\n GLOBALS INCLUDED\n"
#include "contexte.inc"
#include "gadgets.inc"
#include "hexacone.inc"
#include "hexabenz.inc"
#include "hexawood.inc"
#include "trident.inc"
// =======================================================
/* nouveau du 7 octobre 2025 */
#macro Une_Boule ()
sphere {
0, 0.18
#local R = rand(Rng1);
#if (R < 0.333)
pigment { color Red }
#elseif (R < 0.666)
pigment { color Green }
#else
pigment { color Blue }
#end
}
#end // macro
/* TODO
* trouver une meilleure méthode de placement
*/
#declare Les_Boules = object
{
union {
#for (A, 0, 24, 1)
object { Une_Boule ()
#local TX = 2.6 * (A/10) * (0.5 - NormClock);
#local TY = 2 * abs(sin(clock*0.07*A));
#local TZ = 3.0 * cos(NormClock*0.08*A);
translate <TX, TY, TZ>
}
#end // for
}
finish { ambient 0 phong 1 }
//translate <-0.5, -0.5, -0.5> // recalage de l'objet fini
scale 1.3333333
}
// =======================================================
/*
* nouveau du 12 octobre 2025
*/
#macro Cahute_0 ()
#debug "Enter macro Cahute_0\n"
difference {
#local KX = 0.70;
#local KH = 1.60 + rand(Rng1) + rand(Rng1);
#local KZ = KX + (0.24*rand(Rng1));
box { <-KX, 0, -KZ>, <KX, KH, KZ> }
#local KX = KX * 0.99;
#local KH = KH * 0.99;
#local KZ = KZ * 0.99;
box { <-KX, 0, -KZ>, <KX, KH, KZ> }
cylinder { <-10, KH/2, 0>, <10, KH/2, 0>, KX * 0.741 }
#local R = rand(Rng1);
#debug concat("Random = ", str(R, 6, 4), "\n")
#if ( R < 0.33 )
texture { Flashy scale <17, 23, 5> }
#elseif ( R < 0.66 )
texture { T_Beton_1 }
#else
texture { T_Beton_2 }
#end // if
rotate y * (77 * rand(Rng1))
}
#end // macro
#declare Les_Cahutes = object
{
union {
#local K = 2.70;
object { Cahute_0 () translate -x * K }
object { Cahute_0 () translate x * K }
object { Cahute_0 () translate -z * K }
object { Cahute_0 () translate z * K }
}
rotate y * (clock*3.33)
}
// =======================================================
#debug "ACTION !!!\n"
// ------------------------------------------------------ ##
#declare Tridents = object
{
#local RX = -11 + (80*sin(NormClock*9.81) + 3*sin(NormClock*23));
#local RZ = 96 - (54*Cos_010(NormClock));
union {
object { Trident_A () rotate <RX, 0, RZ>
translate < -1.5, 1.0, 0> }
object { Trident_A () rotate <0, clock, 0>
translate < 1.5, 1.8, 0> }
}
}
// ------------------------------------------------------ ##
#declare Gyros = object
{
union {
#for (I, 0, 359, 30)
#declare E = 11;
#declare Dx = E * sin(radians(I));
#declare Dz = E * cos(radians(I));
object { GyroPhare () translate <Dx, 0, Dz> }
// #debug " Gyro !!!\n"
#end
}
}
// ------------------------------------------------------ ##
object { Gyros }
#declare Selector = mod(int(clock/30), 6);
#debug concat("Selector = ", str(Selector, 6, 0), "\n")
#switch (Selector)
#case (0)
object { Tridents scale 1.12 rotate -y*(clock*0.666) }
#break
#case (1)
object { Les_Cahutes scale 0.50 }
#break
#case (2)
object { HexaWood rotate -y*(clock*0.38) translate y }
#break
#case (3)
object { Chose rotate x*5 rotate y*clock }
#break
#case (4)
object { HexaBenz () scale 2 translate 2.7*y rotate -y*clock }
#break
#case (5)
object { Les_Boules translate y }
#break
#end // switch selector
plane {
y, 0
texture { T_Planete_B scale 0.666 }
}
object { Repere translate y*1.0 }
// =======================================================
#local CamX = -2.7 + (1.8*Cos_010(NormClock));
#local CamY = 0.41 + (1.2*exp(NormClock));
#local CamZ = -5.777 + (1.2*Cos_01(NormClock));
#local K = 8.6;
#local CamX = CamX * K;
#local CamY = CamY * K * 0.61;
#local CamZ = CamZ * K;
camera {
#if (clock < 225)
orthographic
#end
location <CamX, CamY, CamZ>
look_at <0, 1.4, 0>
angle 12 - 3*Cos_01(NormClock)
}