Files
HexaCone/essai.pov
2026-02-20 12:51:23 +01:00

403 lines
9.4 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;
// #declare DEBUG_LEVEL = 1; // un nouveau test ?
#include "globals.inc"
#declare NO_DYNAMIC = 1;
#include "all.inc"
/*
* il faut faire le tri ici !
-* __________________________
*/
// =======================================================
// nouveau du 10 février 2026
#macro Anemone_A (E, H)
union {
#for (foo, 0, 5)
#local A = radians(foo*60);
#local DX = E * sin(A);
#local DZ = E * cos(A);
cone { y*(H/8), 0.20, <DX, H, DZ>, 0.001
#local Rv = 0.7 + (0.2*rand(Rng1));
#local Gv = 0.6 + (0.2*rand(Rng1));
#local Bv = 0.6 + (0.3*rand(Rng1));
texture {
pigment { rgb <Rv, Gv, Bv> }
finish { phong 0.51 reflection 0.05 }
}
}
sphere { 0, 0.45 texture { T_WIP_color } }
#end // for
}
#end // macro
// =======================================================
/*
* new Thu Dec 18 01:14:19 AM UTC 2025
* 14 janvier 2026, j'ajoute un truc pour {enfin} gérer
* un DEBUG_LEVEL correct.
*/
#macro Le_ConeStack ()
#ifdef (DEBUG_LEVEL)
#debug "Cone Stack : DEBUG_LEVEL activated\n"
#fopen Log "WS/log.essai" write
#end // debug level
union {
#local Hcs = 0.550;
#local Rco = R_basecone * 3.333;
#for (Foo, 0, 5)
#local Dx = 0.385 * sin(Foo+NormClock);
#local Dy = Foo * (Hcs + 0.0333);
#local Dz = 0.385 * cos(Foo+NormClock);
#local DV = <Dx, Dy, Dz>;
#ifdef (DEBUG_LEVEL)
#write (Log, Foo, " ", DV, "\n")
#end
union {
cone { 0, Rco, <0, Hcs, 0>, 0.001
#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 DV
}
#end // for Foo
}
#ifdef (DEBUG_LEVEL)
#fclose Log
#end // debug level
#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.9> }
object { Wagonnet_0(L+1) translate <0, 3+NormClock, 0> }
object { Wagonnet_0(L) translate <0, 1, -1.8> }
}
}
// =======================================================
/*
* nouveau du 25 octobre 2025
*/
#declare Obj_BasicTexture = object
{
#local R = 0.385;
#local H = 1.51;
merge {
cylinder { 0, y*H, R }
sphere { 0, R scale <1, 0.50, 1> translate y*H }
difference {
#local R1 = R+0.46;
#local R2 = R+0.63;
box { <-0.19, 0, -0.17>, <R+0.4, H*0.48, R+0.6> }
cylinder { <R1, -1, R2>, <R1, 1, R2>, 0.33 }
}
}
}
// -------------------------------------------------------
// -------------------------------------------------------
// the place to try new textures
#declare ProtoTextures = object
{
#local TX = 2.55;
#local TZ = 2.95;
#local Kro = 32 + (NormClock * 37);
union {
object { Obj_BasicTexture texture { R_Texture }
rotate y * (rand(Rng1)*Kro)
translate <TX, 0, -TZ> }
object { Obj_BasicTexture texture { G_Texture }
rotate y * (rand(Rng1)*Kro)
translate <TX, 0, 0> }
object { Obj_BasicTexture texture { B_Texture }
rotate y * (rand(Rng1)*Kro)
translate <TX, 0, TZ> }
object { Obj_BasicTexture texture { T_WIP_dents }
rotate y * (rand(Rng1)*Kro)
translate <-TX, 0, TZ> }
object { Obj_BasicTexture texture { T_WIP_rasta }
rotate y * (rand(Rng1)*Kro)
translate <-TX, 0, 0> }
object { Obj_BasicTexture texture { T_WIP_bluewave }
rotate y * (rand(Rng1)*Kro)
translate <-TX, 0, -TZ> }
object { Repere scale 1.5 translate y*0.5 }
}
}
// =======================================================
/* Les choses, c'est l'espèce de vase avec des tiges
qui bougent, je devrais trouver un nom plus parlant.
Mieux, on garde la chose mais on en dérive le vase
*/
#macro Vase_le_corps_a ()
intersection {
box { <-5, -5, -5>, <5, 0, 5> }
difference {
sphere { 0, 0.34 }
sphere { 0, 0.30 }
scale <1, 1.64, 1>
}
texture { T_WIP_redwave scale 0.15 + 0.333*rand(Rng1)
rotate <75*rand(Rng1), 75*rand(Rng1), 75*rand(Rng1)>
}
}
#end
// ------------------------------------
#macro Vase_le_corps_b ()
union {
#for (foo, 0, 359.999, 60)
#local Dx = 0.35 * sin(radians(foo));
#local Dz = 0.35 * cos(radians(foo));
torus { 0.09, 0.016
rotate z*30 rotate y*(foo-90)
translate <Dx, 0, Dz>
#local R = rand(Rng1);
#if (R < 0.50) texture { Y_Texture }
#else texture { M_Texture }
#end // end if
} // torus
#end // end for (foo
}
#end // end macro
// ------------------------------------
// ASSEMBLER LE CORPS
#macro Vase_le_corps ()
union {
object { Vase_le_corps_a () }
object { Vase_le_corps_b () }
translate y*0.95
}
#end
// ------------------------------------
// LE PIED
#macro Vase_le_pied ()
union {
cylinder { 0, y*0.80, 0.07 texture { T_WIP_dents scale 0.2 } }
cylinder { 0, y*0.08, 0.20 texture { T_WIP_dents scale 0.4 } }
}
#end
// ------------------------------------
// LES TIGES
#macro Vase_les_tiges ()
union {
#local CK = NormClock * (7.876+rand(Rng1));
#for (Foo, 0, 9)
// tout cela est bien tortueux !
#local CK2 = CK + Foo;
#local C2X = (R_C + 0.051) * sin(CK2+rand(Rng1)) * sin(CK*3);
#local C2Z = (R_C + 0.051) * (sin(-CK2+rand(Rng1)) *
cos(CK*(rand(Rng1))));
#local Rt = 0.02+(0.02*Cos_010(NormClock))-0.03*rand(Rng1);
#local H = 0.38 + 0.55*rand(Rng1);
union {
cylinder { 0, <C2X, H, C2Z>, Rt }
sphere { <C2X, H, C2Z>, Rt }
#local R = rand(Rng1);
#if (R < 0.25) texture { tPlasticOrange }
#elseif (R < 0.50) texture { tPlasticBlue }
#elseif (R < 0.75) texture { tPlasticPrune }
#else texture { tPlasticGreen }
#end // if
}
#end // for
translate y*0.87
}
// #debug "== Fin chose les tiges\n"
#end // macro
// ------------------------------------
// ------------------------------------
#macro Vase ()
union {
Vase_le_pied ()
Vase_le_corps ()
Vase_les_tiges ()
}
#end // macro
// ------------------------------------
// =======================================================
#declare Des_Choses = object
{
union {
object { Vase () scale 2 translate < 2.2, 0, 2.32> }
object { Vase () scale 1.4 translate <-2.9, 0, 3.91> }
object { Vase () scale 2 translate < 2.9, 0, -4.07> }
object { Vase () translate <-4.5, 0, -4> }
object { Repere translate 0.15*y }
}
}
// =======================================================
#declare GyroTrucs = object
{
union {
#for (I, 0, 359, 30)
#declare E = 12 + (3*rand(Rng1));
#declare Dx = E * sin(radians(I));
#declare Dz = E * cos(radians(I));
#local R = rand(Rng1);
#if (R > 0.52)
object { GyroPhare () translate <Dx, 0, Dz> }
#elseif (R > 0.36)
object { Colonne_A (3.8)
rotate y*(90*rand(Rng1))
translate <Dx, 0, Dz> }
#else
object { Colonne_A (2.8)
rotate y*(90*rand(Rng1))
translate <Dx, 0, Dz> }
#end
#end // for
}
}
object { GyroTrucs }
// ========================================================##
#declare Architecture = object
{
union {
object { Portique_A () translate z*6.5 }
object { Portique_A () scale 2 translate z*2 }
object { Portique_A () scale 1.8 }
object { Portique_A () scale 2 translate -z*3 }
object { Portique_A () rotate y*9 translate -z*6.5 }
// object { Fleche translate y }
}
}
// ------------------------------------------------------ ##
#debug " !!! ACTION !!!\n"
#local Rv = 0.5 + (0.1*sin(clock*0.113));
#local Gv = 0.11;
#local Bv = 0.2 * abs(sin(clock*0.014));
light_source {
<-32, 40, -7>
colour <Rv, Gv, Bv>
parallel
point_at 0
}
// ------------------------------------------------------ ##
#declare Selector = int(clock/57);
#debug concat("Selector = ", str(Selector, 6, 0), "\n")
#declare AngleCam = 27 - 3*Cos_01(NormClock);
#switch (Selector)
#case (0)
object { Des_Choses }
#local AngleCam = 17;
#break
#case (1)
object { Architecture rotate -y*(clock*0.666) }
#local AngleCam = 31.0;
#break
#case (2)
object { HoleBorder_B (2.222) }
#break
#case (3)
object { HorlogeDouble scale 2 rotate -y*(6*clock) }
object { Repere translate y*1 }
#break
#case (4)
object { Blob_Boxed
scale 4.000
rotate <7, 0, 12> translate 3.7*y
}
#break
#case (5)
object { Anemone_A (3.10-NormClock, 1.50+NormClock)
translate < 4, 0, 0> }
object { Anemone_A (2.40-NormClock, 2.50+NormClock)
translate <-4, 0, 0> }
object { Anemone_A (1.40+NormClock, 1.50*NormClock)
translate < 0, 0, -4> }
object { Anemone_A (1.40+NormClock, 1.50-NormClock)
translate < 0, 0, 4> }
object { Repere }
#break
#case (6)
object { HexaStar scale 3 rotate y*(clock*1.5) translate y*3.5 }
#break
#case (7)
#local Pos = <0.5-NormClock, 0, 0>;
object { ProtoTextures rotate -y*(55*Cos_01(NormClock)) }
#break
#end // switch selector
plane {
y, 0
texture { Ground_Texture }
}
// =======================================================
#local CamX = -2.7 + (1.8*Cos_010(NormClock));
#local CamY = 0.61 + (0.9*exp(NormClock));
#local CamZ = -5.777 + (1.2*Cos_01(NormClock));
#local K = 8.6;
#local CamX = CamX * K;
#local CamY = CamY * K * 0.41;
#local CamZ = CamZ * K;
camera {
orthographic
location <CamX, CamY, CamZ>
look_at <0, 1.5, 0>
right <image_width/image_height, 0, 0>
angle AngleCam
}