HexaCone/splined.pov
2025-10-22 03:00:56 +02:00

127 lines
2.6 KiB
POVRay

/*
* H E X A C O N E - S P L I N E D
*
* new: Sun Oct 19 05:20:49 PM UTC 2025
* https://www.f-lohmueller.de/pov_tut/animate/anim210e.htm
*/
#version 3.7;
#include "globals.inc"
#include "contexte.inc"
#include "hexacone.inc"
#include "hexabenz.inc"
#include "hexawood.inc"
#include "trident.inc"
object { Le_Decor }
#include "dynamic.inc"
// =======================================================
#declare Spline_1 =
spline {
natural_spline
-0.2, <-2, 1.0, -2>, // control point
0.0, < 0, 1.3, -2>, // start point
0.2, < 2, 1.0, -2>,
0.4, < 2, 1.5, 0>,
0.6, < 0, 2.2, 0>,
0.8, <-1, 0.8, 2>,
1.0, < 2, 1.0, 2>, // end point
1.2, < 4, 1.0, 2> // control point
}
#local Scaler = <2, 1, 3>;
#declare ViewSpline = object
{
union {
#for (CK, 0.00, 1.00, 0.0025)
sphere { <0,0,0>, 0.030
texture{
pigment {color rgb <0.20, 0.14, 0.14> }
finish {ambient 0.15 diffuse 0.85 phong 0.6 }
}
translate (Scaler * Spline_1(CK))
}
#end // for loop
} // closing union
}
#declare AllTheSpline = object
{
#local K1 = 0.90 - (NormClock * 0.003);
#local K2 = 1.00 - K1;
#local V1 = NormClock * K1;
#local V2 = V1 + K2;
union {
object { ViewSpline }
#declare P1 = Scaler * Spline_1(V1);
#declare P2 = <1, -1.3, 0.1> + (0.95 * Scaler * Spline_1(V2));
sphere {
0, 0.06
pigment { color Blue }
translate P1
}
sphere {
0, 0.06
pigment { color Red }
translate P2
}
cylinder {
P1, P2, 0.017
pigment { color Green }
}
finish { ambient 0.15 diffuse 0.65 phong 0.4 }
}
#fopen KP "WS/spline.log" append
#write (KP, clock, " / ", NbFrames, " -> ")
#write (KP, NormClock, " ", K1, " ", K2, " = ", V1, " ", V2, "\n")
#fclose KP
}
// =======================================================
#declare Flag = (mod(clock,90) < 45);
#if ( Flag )
object { AllTheSpline scale 10 translate y*2 }
#debug " FLAG IS YES\n"
#else
#debug " FLAG IS NO\n"
#end
#local P1B = (P1 * 10) + <0, 2, 0>;
#local P2B = (P2 * 10) + <0, 2, 0>;
#if ( Flag )
#declare Loc_cam = <87-(12*NormClock), 29-NormClock, 4-(9*exp(NormClock))>;
#declare Lat_tmp = Interpolate(P1, P2, 0.50);
#declare Lat_cam = (Lat_tmp * 10) + <0, 2, 0>;
#declare Ang_cam = 105;
#else
#declare Loc_cam = P1B;
#declare Lat_cam = P2B;
#declare Ang_cam = 52;
#end
// vstr(N,A,S,L,P)
#debug concat(" LOC: ", vstr(3, Loc_cam, " ", 6, 3), "\n")
#debug concat(" LAT: ", vstr(3, Lat_cam, " ", 6, 3), "\n")
// object { Repere scale 4 translate Lat_cam }
camera {
location Loc_cam
look_at Lat_cam
// focal_point <0.37, 0.0, 0>
// aperture 0.046
// blur_samples 30
angle Ang_cam
}