HexaCone/essai.pov
2025-12-18 22:26:31 +01:00

239 lines
5.2 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"
#include "contexte.inc"
#include "gadgets.inc"
#include "hexacone.inc"
#include "hexabenz.inc"
#include "hexawood.inc"
#include "trident.inc"
// XXX
#include "xperiment.inc"
// XXX
// =======================================================
/*
* new Thu Dec 18 01:14:19 AM UTC 2025
*/
#macro Le_ConeStack ()
union {
#local Hcs = 0.50;
#local Rco = R_basecone * 1.95;
#for (Foo, 0, 6)
#local Dy = Foo * 0.580;
union {
cone { 0, Rco, <0, Hcs, 0>, 0.0001
#if (rand(Rng1) < 0.50) texture { Y_Texture }
#else texture { M_Texture }
#end // if rand
}
cylinder { 0, -0.08*y, Rco
#if (rand(Rng1) < 0.50) texture { R_Texture }
#else texture { G_Texture }
#end // if rand
}
translate y * Dy
}
#end // for Foo
}
#end // macro
// =======================================================
/* nouveau du 20 octobre 2025
* Un semblant de wagonnet qui va tourner sur le
* rail circulaire
*/
#declare Les_Wagonnets = object
{
#local L = 2.4;
union {
object { Wagonnet_0(L) translate <0, 1, 1.6> }
object { Wagonnet_0(L+1) translate <0, 2+NormClock, 0> }
object { Wagonnet_0(L) translate <0, 1, -1.8> }
}
}
// =======================================================
/* nouveau du 7 octobre 2025 */
#macro Une_Boule ()
sphere {
0, 0.15 + (rand(Rng1) * 0.07)
#local R = rand(Rng1);
#if (R < 0.333) texture { C_Texture }
#elseif (R < 0.666) texture { M_Texture }
#else texture { Y_Texture }
#end
finish { specular 0.6 }
}
#end // macro
/* TODO
* trouver une meilleure méthode de placement
*/
#declare Les_Boules = object
{
union {
#for (A, 0, 32, 1)
#local CK = (NormClock*55.00) + (A*0.28);
object { Une_Boule ()
#local TX = 1.9 * sin(CK);
#local TY = 1.4 * cos(sin(CK));
#local TZ = 2.0 * cos(1-CK);
translate <TX, TY, TZ>
}
// object { Repere scale 2 }
#end // for
}
}
// =======================================================
/*
* nouveau du 25 octobre 2025
*/
#declare Obj_BasicTexture = object
{
#local R = 0.369;
#local H = 1.2;
merge {
cylinder { 0, y*H, R }
sphere { 0, R scale <1, 0.50, 1> translate y*H }
box { <-0.19, 0, -0.17>, <R+0.4, H*0.39, R+0.6> }
}
}
#declare BasicTextures = object
{
#local TR = 2.20;
union {
object { Obj_BasicTexture texture { R_Texture }
translate <TR*1.4, 0, 0> }
object { Obj_BasicTexture texture { G_Texture }
translate <0, 0, -1> }
object { Obj_BasicTexture texture { B_Texture }
translate <0, 0, TR/2> }
object { Obj_BasicTexture texture { Y_Texture }
translate < TR, 0, TR> }
object { Obj_BasicTexture texture { M_Texture }
translate <-TR, 0, TR> }
object { Obj_BasicTexture texture { C_Texture }
translate <-TR, 0, -TR> }
object { Repere scale 1.5 translate y*2.5 }
}
}
// =======================================================
/* Les choses, c'est l'espèce de vase avec des tiges
qui bougent, je devrais trouver un nom plus parlant */
#declare Des_Choses = object
{
union {
object { Chose () translate < 2.0, 0, 2.32> }
object { Chose () translate <-2.9, 0, 3.91> }
object { Chose () translate < 2.9, 0, -4.07> }
object { Chose () translate <-3.4, 0, -3+NormClock> }
object { Repere scale <3, 4, 3> translate 0.05*y }
}
}
// =======================================================
#declare Gyros = object
{
// #debug " Les gyros !!!\n"
union {
#for (I, 0, 359, 30)
#declare E = 12 + rand(Rng1);
#declare Dx = E * sin(radians(I));
#declare Dz = E * cos(radians(I));
object { GyroPhare () translate <Dx, 0, Dz> }
#end
}
}
object { Gyros }
// ------------------------------------------------------ ##
#debug " !!! ACTION !!!\n"
light_source {
<-18, 54, -7>
colour Gray40
parallel
point_at 0
}
// ------------------------------------------------------ ##
#declare Selector = mod(int(clock/60)+20, 8);
#debug concat("Selector = ", str(Selector, 6, 0), "\n")
#declare AngleCam = 17 - 3*Cos_01(NormClock);
#switch (Selector)
#case (0)
object { Une_Arche (0.333) scale 2 }
#break
#case (1)
object { Les_Arches (1.57) rotate -y*(clock*0.666) }
#declare AngleCam = 22;
#break
#case (2)
object { Le_ConeStack () translate y*0.20 }
#break
#case (3)
object { Des_Choses }
#break
#case (4)
object { Trident rotate <30, 0, 30> translate 0.7*y
rotate -y*clock }
#break
#case (5)
object { Les_Boules translate y*0.8 }
#break
#case (6)
object { Les_Wagonnets rotate y*(clock) }
#break
#case (7)
#local Pos = <0.5-NormClock, 0, 0>;
object { BasicTextures rotate -y*clock translate Pos }
#break
#end // switch selector
plane {
y, 0
texture { Ground_Texture }
}
// 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.6, 0>
angle AngleCam
}