--- Chris Burke <[EMAIL PROTECTED]> wrote: > Oleg Kobchenko wrote: > > Also I think there used to be a 2D Circle Puzzler > > in J, maybe even among Studio demos, but I haven't > > seen it in a while. Does anyone recall? > > > > Something similar to > > http://www.geocities.com/jaapsch/puzzles/circleman.htm > > Early versions of J did have Engel's Enigma puzzle, later renamed the > Turnstile puzzle, see > http://www.geocities.com/jaapsch/puzzles/turnstil.htm at the same site. > > There were problems drawing it in the early versions of J. The diagram > was drawn using a series of arcs or straight lines, then blocks colored > with a gl2 function called (I think) glflood. Unfortunately, glflood was > unreliable and sometimes the color leaked from one block to another, so > the code was fudged to prevent this. Later versions of J dropped > glflood, and hence also Enigma. > > It would be an interesting exercise to redo Enigma with current J.
This kind of geometry is not really easy with geometric primitives now available in gl2. For fixed shapes like these one would have to aproximate the arc segments with polygons. All modern 2D APIs have path-based drawing, where primitives like arcs and higher-order curves are not drawn directly but instead added to a path. Then the path can be filled, stroked or used for masking, etc. http://www.w3.org/TR/SVG11/paths.html An examples of a really simple path-based API is recent Canvas object in Web 2.0 browsers like Safari and Firefox. With current gl2 it theoretically could be possible to accumulate path parts and then convert them to a poligon, which then can be filled and/or stroked. Maybe somebody knows of a lightweight implementation of such thing? For example, here's a minimal set of primitives for this task in CAMiLEON's Migration on Request tool (available with sources) http://www.si.umich.edu/CAMILEON/reports/mor/dev/elems.html Python script converts SVG to flash SWF http://robla.net/1996/svg2swf/ ImageMagick Vector Graphics http://www.imagemagick.org/Usage/draw/#mvg ____________________________________________________________________________________ Yahoo! oneSearch: Finally, mobile search that gives answers, not web links. http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
