Hi list,

I’m trying to produce figures like this, showing motion as a series of 
snap-shots, with the earlier moments more faint.

Attachment: PastedGraphic-1.pdf
Description: Adobe PDF document


Here are three examples of metafun code using transparency and “decorated".


\startMPinclusions
picture ball;
        ball := image(
                draw fullcircle scaled 1cm
                        withshademethod "circular"
                        withshadecenter (.25,.25)
                withcolor "lightgray" shadedinto black;
                draw fullcircle scaled 1cm withpen pencircle scaled 0.8pt;);
\stopMPinclusions

\starttext

\startMPpage
draw decorated (draw ball) withtransparency (1,.2);
draw decorated (draw ball shifted (1cm, 0cm)) withtransparency (1,.4);
draw decorated (draw ball shifted (4cm, 0cm)) withtransparency (1,.6);
draw ball shifted (9cm, 0cm);
\stopMPpage

\startMPpage
draw decorated (draw ball) withtransparency (1,.2);
draw decorated (draw ball shifted (0.25cm, 0cm)) withtransparency (1,.4);
draw decorated (draw ball shifted (1cm, 0cm)) withtransparency (1,.6);
draw ball shifted (2.25cm, 0cm);
\stopMPpage

\startMPpage
draw decorated (draw ball) withtransparency (1,.2);
filldraw fullcircle scaled 1cm withcolor white withpen pencircle scaled 0.8pt 
shifted (0.25cm, 0cm);
draw decorated (draw ball shifted (0.25cm, 0cm)) withtransparency (1,.4);
filldraw fullcircle scaled 1cm withcolor white withpen pencircle scaled 0.8pt 
shifted (1cm, 0cm);
draw decorated (draw ball shifted (1cm, 0cm)) withtransparency (1,.6);
draw ball shifted (2.25cm, 0cm);
\stopMPpage

\stoptext


Transparency alone does a good job if the objects don’t overlap (first 
example). If they do overlap, it’s kind of a mess (second example). I get a 
much better result if I put a white circle behind each transparent ball so that 
they look lighter without showing the earlier objects through  them (third 
example). However, that solution is going to be difficult for more complex 
shapes. I tried drawing the shape using “redecorated () withcolor white", to 
draw the white background object, but only the outline appears white. The 
circular shading disappears altogether, leaving the ball fill area transparent.

I also tried to use something like “softened .8” but could not get that to 
produce any output.

Any ideas?

Thanks!
Gavin
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

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

Reply via email to