diff --git a/05_Mandelbulb/Mandelbulb.lhs b/05_Mandelbulb/Mandelbulb.lhs index 8ebc89f..08fe85c 100644 --- a/05_Mandelbulb/Mandelbulb.lhs +++ b/05_Mandelbulb/Mandelbulb.lhs @@ -47,21 +47,21 @@ It means, the user input will transform the world state. > -- Centralize all user input interaction > inputActionMap :: InputMap World > inputActionMap = inputMapFromList [ -> (Press 'k' , rotate xdir 5) +> (Press 'k' , rotate xdir 5) > ,(Press 'i' , rotate xdir (-5)) -> ,(Press 'j' , rotate ydir 5) +> ,(Press 'j' , rotate ydir 5) > ,(Press 'l' , rotate ydir (-5)) -> ,(Press 'o' , rotate zdir 5) +> ,(Press 'o' , rotate zdir 5) > ,(Press 'u' , rotate zdir (-5)) -> ,(Press 'f' , translate xdir 0.1) +> ,(Press 'f' , translate xdir 0.1) > ,(Press 's' , translate xdir (-0.1)) -> ,(Press 'e' , translate ydir 0.1) +> ,(Press 'e' , translate ydir 0.1) > ,(Press 'd' , translate ydir (-0.1)) -> ,(Press 'z' , translate zdir 0.1) +> ,(Press 'z' , translate zdir 0.1) > ,(Press 'r' , translate zdir (-0.1)) -> ,(Press '+' , zoom 1.1) +> ,(Press '+' , zoom 1.1) > ,(Press '-' , zoom (1/1.1)) -> ,(Press 'h' , resize 1.2) +> ,(Press 'h' , resize 1.2) > ,(Press 'g' , resize (1/1.2)) > ] diff --git a/06_Mandelbulb/Mandelbulb.lhs b/06_Mandelbulb/Mandelbulb.lhs index bfad62d..d8d7c97 100644 --- a/06_Mandelbulb/Mandelbulb.lhs +++ b/06_Mandelbulb/Mandelbulb.lhs @@ -1,17 +1,23 @@ ## Optimization -All feel good from the architecture point of vue. -More precisely, the separation between rendering and world behavior is clear. -But this is extremely slow now. -Because we compute the Mandelbulb for each frame now. +From the architecture stand point all is clear. +If you read the code, you'll see I didn't made everything perfect, for example, I didn't coded nicely the lights. +But I believe it is a good first step and it will be easy to go further. +The separation between rendering and world behavior is clear. +Unfortunately the program of the preceding session is extremely slow. +We compute the Mandelbulb for each frame now. Before we had - Constant Function -> Constant List of Triangles -> Display + +Constant Function -> Constant List of Triangles -> Display + Now we have - World -> Function -> List of Objects -> Atoms -> Display + +World -> Function -> List of Objects -> Atoms -> Display + And the World state could change. Then it is no more straightforward for the compiler to understand diff --git a/prev b/prev index 15c4b06..ea52c96 100755 --- a/prev +++ b/prev @@ -16,7 +16,11 @@ print -- "Create article" print -- "Copy source codes" ycp() { - print -- $* + local precedent="" + for e in $*;do + [[ $precedent != "" ]] && print -- "\t$precedent" + precedent=$e + done cp $* } latestArticleDir=$(ls -l $webroot/latest.ymd | perl -pi -e 's#.*/##; s#.md$##') @@ -25,10 +29,10 @@ for langue in en fr; do [[ ! -d $dst ]] && mkdir -p $dst ycp *.lhs(N) $dst for dir in ??_*(N/); do - mkdir $dst/$dir - ycp $dir/*.{lhs,hs} $dst/$dir + [[ ! -d $dst/$dir ]] && mkdir $dst/$dir + ycp $dir/*.{lhs,hs}(.N) $dst/$dir done done - +print -- "\nRecompile" cd $webroot ./tasks/recompile