I’d like a presentation progress indicator that looks like a boat on waves – and if it works, it can also become a bike on hills or a mars rover on dunes. But my math skills are lacking.

Below’s a mostly working draft.

* I find the waves not yet very convincing. Would it make sense to use a randomized sinus? (How?)

* The boat should sit on the middle wave and be rotated by the current slope. I know I need the “time” of the upper curve and get the 1st derivation, but how?


numeric height,stops,yoffset;
stops := 10;
height := OverlayHeight/10;
path wave;

draw (0,0)--(OverlayWidth,0)--(OverlayWidth,OverlayHeight) withcolor white withpen pencircle scaled 0.01;

for j=1 upto 3:
  definecolor [name="Sea", y=(j/20), c=2*(j/10), m=(j/20)];
  yoffset := height/(j*2);
  wave := (0,0)--(0,yoffset)...
  for i=1 upto stops:
    (OverlayWidth*i/(stops+1), (yoffset) randomized (height/2)) ...
  fill wave withcolor "Sea";

pair pos;
pos := (OverlayWidth * RealPageNumber/NOfPages, height/2 randomized 2);
path ship;
ship := (0,10)---(70,10)...(60,0)---(10,0)...cycle;

fill ship xysized (10,5) shifted pos rotatedaround (pos, 15) withcolor red;






If your question is of interest to others as well, please add an entry to the 

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net

Reply via email to