297 lines
6.9 KiB
POVRay
297 lines
6.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;
|
|
|
|
// #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 */
|
|
#declare Des_Choses = object
|
|
{
|
|
union {
|
|
object { Chose () translate < 2.2, 0, 2.32> }
|
|
object { Chose () translate <-2.9, 0, 3.91> }
|
|
object { Chose () translate < 2.9, 0, -4.07> }
|
|
object { Chose () translate <-4.5, 0, -4> }
|
|
object { Repere translate 0.05*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"
|
|
|
|
light_source {
|
|
<-19, 44, -7>
|
|
colour Gray40
|
|
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 }
|
|
#break
|
|
#case (1)
|
|
object { Architecture rotate -y*(clock*0.666) }
|
|
#local AngleCam = 31.0;
|
|
#break
|
|
#case (2)
|
|
object { HoleBorder_A (2.12) translate y }
|
|
#break
|
|
#case (3)
|
|
object { HorlogeDouble scale 2 rotate -y*(6*clock) }
|
|
object { Repere translate y*1 }
|
|
#break
|
|
#case (4)
|
|
object { Trident_A ()
|
|
scale 1.8
|
|
rotate <35, 0, 12> translate 2.6*y
|
|
rotate -y*(clock*2) }
|
|
#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*0.5) translate y*3 }
|
|
#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.6, 0>
|
|
|
|
right <image_width/image_height, 0, 0>
|
|
angle AngleCam
|
|
}
|