From d16132de305224a94f34530bcd63abcf28636a93 Mon Sep 17 00:00:00 2001 From: Tonton Th Date: Tue, 31 Dec 2024 12:51:12 +0100 Subject: [PATCH] commit video full-v0 --- .gitignore | 2 ++ Makefile | 2 +- contexte.inc | 13 ++++++++++++- elements.inc | 2 +- encode.sh | 5 ++++- essai.pov | 54 ++++++++++++++++++++++++++++++++++++++++++--------- fonctions.sh | 25 +++++++++++++++++++++--- globals.inc | 2 +- linkfarmer.sh | 45 ++++++++++++++++++++++++++++++++++++------ mkloop.sh | 11 ++++++++--- orbite.pov | 0 passage.pov | 22 ++++++++++++++------- topview.pov | 28 ++++++++++++++------------ 13 files changed, 166 insertions(+), 45 deletions(-) create mode 100644 orbite.pov diff --git a/.gitignore b/.gitignore index 3734c16..f42f424 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ frames/* datas/*.xcf +datas/*.ttf +datas/*.jpg WS/*timing WS/log* diff --git a/Makefile b/Makefile index ba60bc3..3b27d33 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ essai.png: essai.pov Makefile $(POVDEP) povray $(POVOPT) -W1280 -H1024 -i$< -o$@ passage.png: passage.pov Makefile $(POVDEP) - povray $(POVOPT) -W1280 -H1024 -K300 -i$< -o$@ + povray $(POVOPT) -W1280 -H1024 -K340 -i$< -o$@ CK=175 scene.png: scene.pov Makefile $(POVDEP) diff --git a/contexte.inc b/contexte.inc index 93cd4c8..61e2ff4 100644 --- a/contexte.inc +++ b/contexte.inc @@ -6,6 +6,17 @@ #declare Rng2 = seed(now*24*60*60); #declare foo = rand(Rng2); +#declare NormClock = clock / 360.0; + +/* ------------------------------------------------------------ */ + +#macro Cos_01( X ) + (0.5-0.5*cos( 3.141592654 * X)) +#end +#macro Cos_010( X ) + (0.5-0.5*cos( 2 * 3.141592654 * X)) +#end + /* ------------------------------------------------------------ */ #declare Rhxba = 0.30; @@ -73,7 +84,7 @@ light_source { #if ( (clock>166) & (clock<213) ) light_source { - <2, 0.30, -2> color Orange + <2, 0.30, -2> color Yellow spotlight radius 12 falloff 20 diff --git a/elements.inc b/elements.inc index d72085b..f5fb595 100644 --- a/elements.inc +++ b/elements.inc @@ -34,7 +34,7 @@ union { cylinder {-z, z, 0.10 } } // clignotement de la lumiere \o/ - #local kR = 0.083; + #local kR = 0.073; #local xR = (rand(Rng2)-0.5000) * kR; #local yR = (rand(Rng2)-0.5000) * kR; #local zR = (rand(Rng2)-0.5000) * kR; diff --git a/encode.sh b/encode.sh index d6cdd88..80be4ff 100755 --- a/encode.sh +++ b/encode.sh @@ -1,5 +1,8 @@ #!/bin/bash +set -e ; set -u + + source ./fonctions.sh -ff_encodage essai wip.mp4 +ff_encodage passage wip.mp4 diff --git a/essai.pov b/essai.pov index 1fcb486..b95fbc9 100644 --- a/essai.pov +++ b/essai.pov @@ -1,5 +1,5 @@ /* - * H E X A C O N E + * H E X A C O N E - E S S A I * nouveau projet Thu Dec 5 11:37:05 AM UTC 2024 */ @@ -10,6 +10,7 @@ #include "colors.inc" #include "metals.inc" #include "textures.inc" +#include "stones.inc" #declare NormClock = clock / 360.0; #include "contexte.inc" @@ -17,21 +18,56 @@ // ======================================================= +#declare RHBlo = 0.25; +#declare RHBlo2 = RHBlo * 0.55; + +#declare HexaBlob = object +{ +blob { + // threshold 0.01 + NormClock + threshold 0.01 + sphere { <0, 0, 0>, RHBlo, 1 } + #local E = RHBlo * 1.210; + #local W = 0.1; + sphere { <-E, 0, 0>, RHBlo2, W } + sphere { < E, 0, 0>, RHBlo2, W } + sphere { < 0, -E, 0>, RHBlo2, W } + sphere { < 0, E, 0>, RHBlo2, W } + sphere { < 0, 0, -E>, RHBlo2, W } + sphere { < 0, 0, E>, RHBlo2, W } + } +} + // ======================================================= +object { + HexaBlob + #local SC = 1.111 + abs(sin(NormClock * 4 * 3.14159)); + texture { T_Stone26 + scale SC + translate 2*y*NormClock + } + translate < 0, 1, 0> + } + +object { Repere } + +#if (0) object { HexaBalls - #local SC = 0.10 + abs(sin(NormClock * 3.14159)); + #local SC = 0.10 + abs(sin(NormClock * 4 * 3.14159)); texture { Lightning2 scale SC } - translate <0, 1, 0> } + translate <-0.80, 1, 0> } +#end + // ======================================================= -light_source { <-6, 7, -5>, rgb <0.81, 0.65, NormClock> } -light_source { <-6, 7, 5>, rgb <0.31, NormClock, 0.80> } -light_source { < 6, 7, 4>, rgb <1-NormClock, 0.28, 0.80> } +light_source { <-8, 7, -9>, rgb <0.81, 0.65, NormClock> } +// light_source { <-11, 7, 9>, rgb <0.31, NormClock, 0.80> } +light_source { < 11, 7, 4>, rgb <1-NormClock, 0.28, 0.80> } camera { - location <-1.20, 1.81, 1.59> - look_at <0, 1.0, 0> - angle 90 + location <-0.7+NormClock, 1.81, 2.59> + look_at <0.0, 1.0, 0> + angle 64 } diff --git a/fonctions.sh b/fonctions.sh index c92d727..ee33b96 100644 --- a/fonctions.sh +++ b/fonctions.sh @@ -1,10 +1,25 @@ set -eu +# -------------------------------------------------------------- +ralentisseur () +{ +temps=$1 + +echo "#+++ ralentisseur $temps +++#" | tee -a WS/log + + sleep $temps + +} + +# -------------------------------------------------------------- + ff_encodage() { SRCDIR="$1" FILMNAME="$2" + +echo "Encoding $SRCDIR to $FILMNAME" | tee -a WS/log ffmpeg -nostdin \ -y -r 30 -f image2 -i frames/${SRCDIR}/%05d.png \ -metadata artist='--[ tTh ]--' \ @@ -14,13 +29,15 @@ ffmpeg -nostdin \ -tune film \ $FILMNAME -echo "$SRCDIR -> $FILMNAME" | tee -a WS/log -wc -c $FILMNAME | tee -a WS/log - +# wc -c $FILMNAME | tee -a WS/log } +# -------------------------------------------------------------- mp_encodage() { +# +# NOT WORKING ! +# mencoder 'mf://frames/*.png' \ -mf \ fps=24 \ @@ -29,3 +46,5 @@ mencoder 'mf://frames/*.png' \ -o output.avi } +# -------------------------------------------------------------- +# -------------------------------------------------------------- diff --git a/globals.inc b/globals.inc index 1670ae2..6011c61 100644 --- a/globals.inc +++ b/globals.inc @@ -2,5 +2,5 @@ global_settings { assumed_gamma 1.0 ambient_light rgb <0.18, 0.14, 0.17> - max_trace_level 10 + max_trace_level 15 } diff --git a/linkfarmer.sh b/linkfarmer.sh index 97678ca..5369191 100755 --- a/linkfarmer.sh +++ b/linkfarmer.sh @@ -1,28 +1,61 @@ #!/bin/bash set -e ; set -u - source ./fonctions.sh IDX=0 SPOOL="frames/Spool" +# ------------------------------------------------------- +addfile () +{ +src="$1" +dstname=$(printf "%s/%05d.png" $SPOOL $IDX) +# echo "$src -> $dstname" +# ln --force --symbolic $src $dstname +cp -f $src $dstname +IDX=$(( IDX + 1 )) +} +# ------------------------------------------------------- linkfarm () { SRC="frames/$1" echo "linkfarm $SRC" | tee -a WS/log +local NBRE=36 +for foo in $(seq 0 $NBRE) +do + addfile "$SRC/00000.png" +done + for src in "$SRC"/* do - dstname=$(printf "%s/%05d.png" $SPOOL $IDX) - echo "$src -> $dstname" - # ln --force --symbolic $src $dstname - cp -f $src $dstname - IDX=$(( IDX + 1 )) + addfile $src +done + +for foo in $(seq 0 $NBRE) +do + addfile "$SRC/00359.png" done sync } +# ------------------------------------------------------- +faire_le_titre () +{ +echo "faire le titre" + +local NBRE=80 +for foo in $(seq 0 $NBRE) +do + addfile "datas/cover.png" +done +} +# ------------------------------------------------------- + +faire_le_titre + +ralentisseur 10 linkfarm topview linkfarm passage diff --git a/mkloop.sh b/mkloop.sh index af984fd..074413c 100755 --- a/mkloop.sh +++ b/mkloop.sh @@ -12,6 +12,9 @@ case $TYPE in "gif89a") DIMS="-W640 -H480" ;; "mp4") DIMS="-W1024 -H768" ;; esac + +echo "Running $0 $TYPE $SEQNAME" >> WS/log + POVOPT="+q9 +a0.02 -d ${DIMS} -WT6" echo $POVOPT ; echo ; sleep 2 @@ -19,6 +22,7 @@ TMPIMG=/dev/shm/${SEQNAME}-tmp.png for frame in $(seq 0 $((NBFRAMES-1))) do + figlet -k $frame img=$(printf "frames/%s/%05d.png" $SEQNAME $frame) debut=$(date +%s) @@ -27,14 +31,15 @@ do err=$? if [ $err != 0 ] ; then echo "$SEQNAME fail $frame" >> WS/log - sleep 4 + sleep 6 continue fi set -e - txt=$(printf "#%03d" $frame) + txt=$(printf "%s %03d" ${SEQNAME} $frame) echo $frame $img $txt convert ${TMPIMG} \ - -pointsize 16 \ + -font Courier \ + -pointsize 14 \ -fill orange \ -gravity south \ -annotate +0+0 "$txt" \ diff --git a/orbite.pov b/orbite.pov new file mode 100644 index 0000000..e69de29 diff --git a/passage.pov b/passage.pov index 20c3dfa..4469082 100644 --- a/passage.pov +++ b/passage.pov @@ -11,21 +11,29 @@ #include "metals.inc" #include "textures.inc" -#declare NormClock = clock / 360.0; #include "contexte.inc" #include "elements.inc" // --------------------------------------- -#declare PosX = 0; -#declare PosY = 1.20 + (NormClock*0.20); -#declare PosZ = (NormClock-0.5) * 8.44; +#declare PosX = 0.333; +#declare PosY = 1.20 + (NormClock*0.22); +#declare PosZ = (NormClock-0.5) * 29.22; object { HexaCone translate } - +#if ( clock > 130 ) +light_source { + <2, 0.30, -2> color Red + spotlight + radius .044 + falloff 2 + tightness 10 + point_at + } +#end camera { - location <-1.50, 1.23, 9> - look_at + location <-1.56, 1.03, 9.76> + look_at // focal_point <0, 1, 0> // aperture 0.046 // blur_samples 30 diff --git a/topview.pov b/topview.pov index 6b109a9..8c64604 100644 --- a/topview.pov +++ b/topview.pov @@ -1,5 +1,5 @@ /* - * H E X A C O N E + * H E X A C O N E - T O P V I E W * nouveau projet Thu Dec 5 11:37:05 AM UTC 2024 */ @@ -11,24 +11,28 @@ #include "metals.inc" #include "textures.inc" -#declare NormClock = clock / 360.0; #include "contexte.inc" #include "elements.inc" light_source { <-16, 17, -24>, rgb <0.51, 0.65, 0.40> } -#declare TrX = 2 * sqrt(NormClock); -#declare TrY = 1.11 + (5 * sqrt(NormClock)); -#declare TrZ = 3 * sqrt(NormClock); +#declare TrX = 1.4 * sqrt(NormClock); +#declare TrY = 0.90 + (3.5 * sqrt(NormClock)); +#declare TrZ = 9.9 * sqrt(NormClock); #declare TrH = ; +#declare RrY = 57 * sqrt(NormClock); -object { HexaCone translate TrH } +object { HexaCone rotate y*RrY translate TrH } +// object { Repere scale 2 } + +#declare CamY = 19 - (5*NormClock); +#declare LatY = -4 + NormClock; camera { - location <-3.60, 19.60-NormClock, 21.09> - look_at <0, -4, 0> - focal_point <0, 1, 0> - aperture 0.046 - blur_samples 30 - angle 50 + location <-3.60, CamY, 21.09> + look_at <0, LatY, 0> + // focal_point <0, 1, 0> + // aperture 0.046 + // blur_samples 30 + angle 47 }