From c65090e4a244591d9fa7e43c596d51546031195a Mon Sep 17 00:00:00 2001 From: Tonton Th Date: Fri, 7 Mar 2025 10:51:57 +0100 Subject: [PATCH] commit big mess before refactoring --- .gitignore | 1 + Makefile | 11 ++++++--- carto.pov | 33 +++++++++++++++++++++++++++ contexte.inc | 37 +++++++++++++++++------------- cutoff.pov | 9 +++----- dynamic.inc | 50 +++++++++++++++++++++++++++++++++-------- escadrille.pov | 39 +++++++++++++++++++++----------- essai.pov | 38 ++++++++++++++----------------- globals.inc | 5 +++-- hexabenz.inc | 3 ++- hexabenz.pov | 4 ++-- hexacone.pov | 5 +++-- passage.pov | 9 ++++---- remote.pov | 3 ++- scene.pov | 3 ++- survol.pov | 20 +++++------------ topview.pov | 2 +- trident.inc | 61 ++++++++++++++++++++++++++++++++++++++++++++++---- 18 files changed, 233 insertions(+), 100 deletions(-) create mode 100644 carto.pov diff --git a/.gitignore b/.gitignore index 80922af..5d519ff 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ datas/*.webp WS/*timing WS/log* WS/*.done +WS/*.log *.png *.gif diff --git a/Makefile b/Makefile index 6c32d6b..8931a48 100644 --- a/Makefile +++ b/Makefile @@ -6,12 +6,12 @@ POVDEP = contexte.inc elements.inc hexabenz.inc \ globals.inc hexawood.inc datas/hf.png \ dynamic.inc trident.inc -CK=230 - +CK=180 PNG: essai.png scene.png topview.png passage.png \ orbite.png hexabenz.png escadrille.png \ - hexacone.png remote.png survol.png cutoff.png + hexacone.png remote.png survol.png cutoff.png \ + carto.png echo "make PNG ck=$(CK) done" >> WS/log @@ -47,3 +47,8 @@ remote.png: remote.pov Makefile $(POVDEP) survol.png: survol.pov Makefile $(POVDEP) povray $(POVOPT) $(DIMS) +K$(CK) -i$< -o$@ + +carto.png: carto.pov Makefile $(POVDEP) + povray $(POVOPT) $(DIMS) +K$(CK) -i$< -o$@ + + diff --git a/carto.pov b/carto.pov new file mode 100644 index 0000000..374a0ce --- /dev/null +++ b/carto.pov @@ -0,0 +1,33 @@ +/* + * H E X A C O N E + * nouveau projet Thu Dec 5 11:37:05 AM UTC 2024 + */ + +#version 3.7; + +#include "globals.inc" + +#include "contexte.inc" +#include "elements.inc" +#include "hexabenz.inc" +#include "hexawood.inc" +#include "trident.inc" + +#include "dynamic.inc" + +// --------------------------------------------------------- +#for (Foo, -150, 150, 10) + cylinder { <-150, 0, Foo>, <150, 0, Foo>, 0.12 } + cylinder { , , 0.12 } +#end + +// --------------------------------------------------------- + +object { Le_Decor } + +camera { + location <45, 126, 18> + look_at <0, 1.18, 0.17> + angle 50 + } + diff --git a/contexte.inc b/contexte.inc index 7c58d09..374ef73 100644 --- a/contexte.inc +++ b/contexte.inc @@ -9,10 +9,6 @@ * nouveau debut fevrier 2025 - we love raytracing * * une cabane pour faire riche. - */ - - -/* * une seule forme de cabane pour le moment */ #declare Base_cabane_forme = object @@ -48,8 +44,8 @@ texture { T_Beton_2 } #declare GroudBase_coin = object { merge { - cylinder { 0, y*0.4, 0.09 } - sphere { 0, 0.09 scale <1, 0.23, 1> translate y*0.4 } + cylinder { 0, y*0.5, 0.09 } + sphere { 0, 0.10 scale <1, 0.23, 1> translate y*0.5 } } } @@ -74,7 +70,7 @@ texture { T_Grnt7 rotate 49 scale 0.22 } #declare GroundBase_b = object { -#local Sz = SzBase - 0.02; +#local Sz = SzBase - 0.14; union { box { <-SzBase, 0, -SzBase>, } object { GroudBase_coin translate <-Sz, 0, -Sz> } @@ -99,6 +95,7 @@ union { object { GroundBase_a translate Dz } object { Cabane_Base_2 rotate y*180 translate Dz } } +translate y*H_sol } /* ======================================================= */ @@ -243,31 +240,41 @@ height_field { // normal { bumps 0.035 scale 0.186 } finish { phong 0.105 } } + translate y*H_sol } } /* ======================================================= */ +#declare UnderHoles = array[6] + +#fopen Holes "WS/holes.log" write +#for (Idx, 0, 5) + #local Angle = Idx* 1.07825; + #local Px = sin(Angle) * (SzSol * 1.21); + #local Pz = cos(Angle) * (SzSol * 1.21); + #declare UnderHoles[Idx] = ; + #write (Holes, Idx, " ", Angle, " ", UnderHoles[Idx], "\n") +#end +#fclose Holes + #declare Underground = object { difference { // plane { y, 0 } #local Big = 300; - box { <-Big, -0.01, -Big>, < Big, 0.01, Big> } + box { <-Big, -0.10, -Big>, < Big, 0.01, Big> } #undef Big - #local W = SzSol * 1.204; - cylinder { <-W, -1, -W>, <-W, 1, -W>, 5 } - cylinder { <-W, -1, W>, <-W, 1, W>, 7 } - cylinder { < W, -1, W>, < W, 1, W>, 9 } - #undef W + #for (Foo, 0, 5) + cylinder { -y*5, y*5, 4 translate UnderHoles[Foo] } + #end } texture { pigment { color Gray20 } normal { bumps 0.38 scale 3 } finish { phong 0.125 } } -rotate y*35 -translate -y*2.55 +// translate -y*1.55 } /* ======================================================= */ diff --git a/cutoff.pov b/cutoff.pov index d13959b..0263a60 100644 --- a/cutoff.pov +++ b/cutoff.pov @@ -13,14 +13,11 @@ // ======================================================= -// #debug concat("------ cutoff clock = ", str(clock,5,0),"\n") - - #declare Kbox = (2.03*NormClock); difference { object { HexaCone () } box { -1, 1 translate z*Kbox } - translate y*1.5 + translate y*2.5 } /* this one is for debugging */ @@ -33,11 +30,11 @@ object { Le_Decor } // ======================================================= -#local CamX = -2.7 + (1.4*Cos_01(NormClock)); +#local CamX = -2.7 + (1.8*Cos_01(NormClock)); #local CamY = 2.58 + (0.034*sqrt(NormClock)); #local CamZ = 5.35; camera { location - look_at <0, 1.6, 0> + look_at <0, 2.6, 0> angle 39 - 5*Cos_01(NormClock) } diff --git a/dynamic.inc b/dynamic.inc index 8949e63..1327bd1 100644 --- a/dynamic.inc +++ b/dynamic.inc @@ -1,10 +1,43 @@ +/* + */ object { Les_Bibelots rotate y*clock translate <28, -1, -32> } +/* + * on fait passer un hexatruc dans le ciel + */ +#declare A = <-SzSol, 22, -10>; +#declare B = < SzSol+4, 18, -11>; +#declare P = Interpolate(A, B, NormClock); +object { HexaCone () rotate y*((12*NormClock)+80) translate P } -#declare HC_A = <0.03, 1.18, 0.17>; -#declare HC_B = <2.0, 5.0, 9.0>; +/* + * le vaisseau "trident" passe a travers les + * trous de l'underground + */ + +#declare Truc = object +{ +cylinder { -y, y, 0.8 } +pigment { color Red } +} + +#fopen Trid "WS/tridents.log" write +#for (Foo, 0, 5) + #declare Dy = -3+(11*NormClock); + #declare Tr = UnderHoles[Foo] + <0, Dy, 0>; + #write (Trid, Foo, " ", NormClock, " ", Dy, " ", + UnderHoles[Foo], " ", Tr, "\n") + object { Trident_A () translate Tr } +#end +#fclose Trid + +/* + * echange hexacone et hexabenz + */ +#declare HC_A = <0.03, 2.18, 0.17>; +#declare HC_B = <3.00, 11.07, 11.09>; #declare HC_P = Interpolate(HC_A, HC_B, Cos_01(NormClock)); #declare RX = -9+(NormClock*11); #declare RY = 122 * (exp(NormClock) - 1.0); @@ -12,19 +45,18 @@ object { HexaCone () rotate translate HC_P } - -#declare HB_A = <-4.0, 7.0, 5.0>; -#declare HB_B = <0.03, 1.22, 0.17>; +#declare HB_A = <-5.00, 10.0, 6.33>; +#declare HB_B = < 0.03, 2.32, -0.37>; #declare HB_P = Interpolate(HB_A, HB_B, Cos_01(NormClock)); -#declare RY = -75 * (exp(NormClock*2) - 1.0); +#declare RY = -75 * (exp(NormClock*1.8) - 1.0); #declare RZ = -7+(7*NormClock); object { HexaBenz () rotate <6, RY, RZ> translate HB_P } /* - * nouveau 11 fevrier 2025 + * passage d'un hexawood près de la base */ -#declare A = <-21, -1.9, (SzSol/2)+8>; -#declare B = < 24, -2.4, (SzSol/2)+5>; +#declare A = <-21, 1.1, (SzSol/2)+8>; +#declare B = < 24, 1.1, (SzSol/2)+5>; #declare P = Interpolate(A, B, NormClock); object { HexaWood translate P } diff --git a/escadrille.pov b/escadrille.pov index b72de1e..a0294e8 100644 --- a/escadrille.pov +++ b/escadrille.pov @@ -11,35 +11,48 @@ #include "contexte.inc" #include "elements.inc" #include "hexabenz.inc" +#include "hexawood.inc" +#include "trident.inc" // ======================================================= -#for (idX, 0, 5) - #for (idZ, 0, 5) +#include "dynamic.inc" - #local posX = (idX * 4.72) - 11.6 + (rand(Rng1)-0.5); +#for (idX, -3, 3) + #for (idZ, -3, 3) + + #local posX = (idX * 4.72) + (rand(Rng1)-0.5); #local posY = 3.1 + (1.2*(rand(Rng1)-0.5)); - #local posZ = (idZ * 4.37) - 7.9; + #local posZ = (idZ * 4.37) ; #local Rx = (rand(Rng1) - 0.5) * 8; #local Ry = (rand(Rng1) - 0.5) * 14; #local Rz = (rand(Rng1) - 0.5) * 11; - #if (rand(Rng1) < 0.515) - object { HexaCone () - rotate + +// #debug concat("X ", str(posX,7,3), " Z ", str(posZ,7,3), "\n") +// #debug concat("position Z ", str(posZ,7,3),"\n") + + #if ( (abs(posX)>1) & (abs(posZ)>0.5) ) + + #if (rand(Rng1) < 0.555) + object { HexaCone () rotate translate } #else - object { HexaBenz () - rotate + object { HexaBenz () rotate translate } #end - #end -#end + +// #debug "\n" + + + #end // if pos... + #end // loop IDX +#end //loop idZ // ======================================================= object { Le_Decor } -// object { Repere scale 5 translate y } +// object { Repere scale 5 translate y } #local CamX = -8.7 + (6.6*Cos_01(NormClock)); #local CamY = 2.95 + (18.64*Cos_01(NormClock)); @@ -48,5 +61,5 @@ object { Le_Decor } camera { location look_at <0.0, -NormClock, 0> - angle 60 - (3.97 * NormClock) + angle 64 - (3.97 * NormClock) } diff --git a/essai.pov b/essai.pov index 3a6febd..7b8af8d 100644 --- a/essai.pov +++ b/essai.pov @@ -15,41 +15,37 @@ // ======================================================= -#include "dynamic.inc" +// #include "dynamic.inc" // ======================================================= -// object { OpenBox translate y*1.30 } -#if (0) -#local RX = -11 + (10*sin(NormClock*9.81) + 3*sin(NormClock*23)); -#local RZ = 26 - (14*Cos_010(NormClock)); -object { HexaWood rotate translate <9, 2.777, -11> } +#include "trident.inc" + + +#if (1) +#local RX = -11 + (80*sin(NormClock*9.81) + 3*sin(NormClock*23)); +#local RZ = 96 - (54*Cos_010(NormClock)); +object { Trident_A () rotate translate < -1.5, 0, 0> } +object { Trident_A () rotate translate < 1.5, 0, 0> } #end -/* -#declare A = <-21, -0.9, SzSol+9>; -#declare B = < 33, -0.7, SzSol+7>; -#declare P = Interpolate(A, B, NormClock); -object { HexaWood translate P } -*/ - -object { Repere scale 10 translate y*6 } -object { Le_Decor } +object { Repere } +//.object { Le_Decor } // ======================================================= #local CamX = -2.7 + (2.8*Cos_010(NormClock)); -#local CamY = 0.81 + (3*exp(NormClock)); -#local CamZ = 7.777 - (0.8*Cos_010(NormClock)); +#local CamY = 0.21 + (2.3*exp(NormClock)); +#local CamZ = 5.777 - (0.8*Cos_010(NormClock)); -#local K = 8; +#local K = 3.4; #local CamX = CamX * K; -#local CamY = CamY * K * 2; +#local CamY = CamY * K; #local CamZ = CamZ * K; camera { location - look_at <0, 0.98, 0> - angle 32 - 5*Cos_01(NormClock) + look_at <0, 0, 0> + angle 20 - 5*Cos_01(NormClock) } diff --git a/globals.inc b/globals.inc index 50e5ce8..edca427 100644 --- a/globals.inc +++ b/globals.inc @@ -24,9 +24,10 @@ global_settings { */ #declare SzSol = 34; +#declare H_sol = 0.500; -#declare SzBase = 2.85; -#declare H_base = 0.10; +#declare SzBase = 2.90; +#declare H_base = 0.50; #declare R_basecone = 0.117; #declare H_cone = 0.97; diff --git a/hexabenz.inc b/hexabenz.inc index 4e52d0f..2afaaed 100644 --- a/hexabenz.inc +++ b/hexabenz.inc @@ -9,7 +9,8 @@ union { #local RA = R_basecone; #local RB = 0.001; cone { 0, RA, y*0.89, 0.0001 } - sphere { 0, RA*1.098 scale <1, 0.58, 3.03> translate -0.02*y } + sphere { 0, RA*1.098 scale <1, 0.58, 3.03> + translate -0.02*y } } // } #end diff --git a/hexabenz.pov b/hexabenz.pov index 41bb912..de750bf 100644 --- a/hexabenz.pov +++ b/hexabenz.pov @@ -17,8 +17,8 @@ #local K = 1.48; -object { HexaBenz () rotate y*90 translate <-K, 1.85, 0> } -object { HexaBenz () translate < K, 1.67, 0> } +object { HexaBenz () rotate y*90 translate <-K, 2.85, 0> } +object { HexaBenz () translate < K, 2.67, 0> } // ======================================================= diff --git a/hexacone.pov b/hexacone.pov index abda359..af5e5d5 100644 --- a/hexacone.pov +++ b/hexacone.pov @@ -9,10 +9,11 @@ #include "contexte.inc" #include "elements.inc" #include "hexabenz.inc" +// #include "trident.inc" #local K = 1.48; -object { HexaCone () rotate y*90 translate <-K, 1.7, 1> } -object { HexaCone () translate < K, 1.6, 1> } +object { HexaCone () rotate y*90 translate <-K, 2.7, 1> } +object { HexaCone () translate < K, 2.6, 1> } object { Le_Decor } diff --git a/passage.pov b/passage.pov index caa838a..3458c5a 100644 --- a/passage.pov +++ b/passage.pov @@ -11,6 +11,7 @@ #include "elements.inc" #include "hexabenz.inc" #include "hexawood.inc" +#include "trident.inc" // --------------------------------------- @@ -18,10 +19,10 @@ #declare PosX = 2.95; #declare PosY = 2.60 + (NormClock*0.28); -#declare PosZ = (NormClock-0.5) * 53.27; +#declare PosZ = (NormClock-0.5) * 41.27; object { HexaCone () translate } -object { HexaCone () translate } +object { HexaCone () translate } object { HexaBenz () translate } object { Le_Decor } @@ -40,7 +41,7 @@ light_source { #if ( (clock > 230) & (clock < 300) ) light_source { - <2, 0.30, -2> color White + <2, 0.30, -2> color Green spotlight radius .044 falloff 2 @@ -50,7 +51,7 @@ light_source { #end camera { - location <-2.76, 1.03, 9.76> + location <-2.76, 1.03, 8.76> look_at // focal_point <0, 1, 0> // aperture 0.046 diff --git a/remote.pov b/remote.pov index f1b7080..245b752 100644 --- a/remote.pov +++ b/remote.pov @@ -11,6 +11,7 @@ #include "elements.inc" #include "hexabenz.inc" #include "hexawood.inc" +#include "trident.inc" #declare A = <-SzSol, 16, -8>; #declare B = ; @@ -34,7 +35,7 @@ object { Le_Decor } // object { Repere scale 3 translate } -#local DistCam = 239; +#local DistCam = 280; #local CK = 0.56 + (0.72 * NormClock); #declare CamX = DistCam * sin(CK); #declare CamY = 28; diff --git a/scene.pov b/scene.pov index e74e251..f918de8 100644 --- a/scene.pov +++ b/scene.pov @@ -11,6 +11,7 @@ #include "elements.inc" #include "hexabenz.inc" #include "hexawood.inc" +#include "trident.inc" #include "dynamic.inc" @@ -18,7 +19,7 @@ object { Le_Decor } -#declare CK = 96 + (clock * 0.36); +#declare CK = 144 + (clock * 0.36); #declare Dcam = 3.55; #declare CamX = Dcam * sin(radians(CK)); #declare CamZ = Dcam * 1.20 * cos(radians(CK)); diff --git a/survol.pov b/survol.pov index 5faaa00..4ff3238 100644 --- a/survol.pov +++ b/survol.pov @@ -11,30 +11,20 @@ #include "elements.inc" #include "hexabenz.inc" #include "hexawood.inc" +#include "trident.inc" // ======================================================= -/* - * on fait passer un hexatruc - */ -#declare A = <-SzSol, 16, 9>; -#declare B = < SzSol+4, 18, 11>; -#declare P = Interpolate(A, B, NormClock); -object { HexaCone () rotate y*((12*NormClock)+80) translate P } - - #include "dynamic.inc" - - object { Le_Decor } -// object { Repere translate y*2 } +object { Repere scale 2 translate y*2 } // ======================================================= -#declare Debut = <-3, 57, 47> ; -#declare Fin = < 2, 53, 7> ; +#declare Debut = <-3, 87, 47> ; +#declare Fin = < 2, 99, 7> ; #declare Pos = Cos_01(NormClock); #declare PosCam = Interpolate(Debut, Fin, Pos); @@ -43,6 +33,6 @@ object { Le_Decor } camera { location PosCam look_at LatCam - angle 54 + angle 58 } diff --git a/topview.pov b/topview.pov index 6eac9c6..be99d3a 100644 --- a/topview.pov +++ b/topview.pov @@ -11,7 +11,7 @@ #include "elements.inc" #include "hexabenz.inc" #include "hexawood.inc" - +#include "trident.inc" /* XXX #declare TrX = 1.84 * sqrt(NormClock); diff --git a/trident.inc b/trident.inc index 5be4f73..b2b2ee1 100644 --- a/trident.inc +++ b/trident.inc @@ -1,10 +1,63 @@ +#declare Trid_length = 2; +// ------------------------------------------------------ +#declare Trid_cone = object +{ +cone { 0, R_basecone, y*0.89, 0.0001 } +} -/* ------------------------------------------------------ - * - */ - +#macro Trid_A_cone () +difference { + object { Trid_cone } + object { Trid_cone } + #local Foo = rand(Rng1); + #if (Foo < 0.333) + pigment { color Red } + #elseif (Foo < 0.666) + pigment { color Green } + #else + pigment { color Blue } + #end // else + #undef Foo + } +#end // macro +// ------------------------------------------------------ +#macro Trid_A_head () +union { + #for (A, 0, 360, 120) + #local E = 0.44; + #local Tx = E * sin(radians(A)); + #local Ty = 0; + #local Tz = E * cos(radians(A)); + object { Trid_A_cone () translate } + #undef Tx + #undef Ty + #undef Tz + #end // for + } +#end +// ------------------------------------------------------ +#declare Trid_A_body = object +{ +#local L = Trid_length / 2; +merge { + cylinder { <0, -L, 0>, <0, L, 0>, 0.065 } + sphere { 0, 0.065 scale <1, 4, 1> translate y*L } + texture { WIP_color } + } +#undef L +} +// ------------------------------------------------------ +// ------------------------------------------------------ +#macro Trident_A () +union { + object { Trid_A_head () translate y*0.95 } + object { Trid_A_body } + // object { Trid_A_tail } + } +#end +// ------------------------------------------------------