Have a look of the constructor of GG/DrawerEngine.java. Currently we have a few default ActionScripts (formerly named drawing modules) already defined (moduleR, moduleP, moduleI). When you start the application GG/GGGui.java, you'll see they show up as a square blocks R, P and I in the right panel. Click on each of them, and then click on the "Event" tab on the left panel. Drag the OnCall event "codelet" to the middle window. Then you'll see the series of default instructions associated with the OnCall event codelet. Your task is to produce something similar with the "ToDraw" event codelet of another object of class SprayCan (which appears as a square with "*" in the right render window). That is to say, when I select the SprayCan object on the right render window, and then drag the "ToDraw" event codelet to the middle window, I can see a series of default instructions. Indeed these instructions will be executed once I click on the RUN button. You may perhaps try to reproduce a default script similar to what is shown at https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHQLKP_lbg_e8c0hUaSPXzH4msjxoybWPj0eJ63PehCnAeP2LKR2U1L6N0Ojvm5KFiU7vSE_yrCbulogAE91A_HfNo4osSVNh5R1Vzw-H_VFxP8JR0W_MizJQXfPUoE7IiYgJ8yEVcSvzr/s1600/shape.bmp as a starter. I think the goal is to produce a simple example script that can demonstrate the possibility of the program.
GG Border idea:
The border issue involves coding a method codelet to draw a flood-filled region defined by a series of points. Examples of method codelets can be found in GG/SprayCan.java and GG/ActionScript.java. Each of them is started with something like @AutomatableMethod and then a typical method definition. Inputs should be
* The coordinates of a few points (perhaps 4 points) which define the boundary of the graffiti shape
* For each border line, the width (starting from 0 to some finite value) and the color of the border
* The flood-fill color
I expect the method, when called, can produce a progressive animation of flood-filling the region defined by the boundary. An example of progressive animation can be found in the SprayCan's method MoveBy(), whose effect is shown at http://csdt-laut.blogspot.com/2010/04/work-progress-apr-7-apr-14.html
To animate the flood-filling sequence, I suggest scanline conversion (http://www.siggraph.org/education/materials/HyperGraph/scanline/outprims/polygon2.htm).
Some minor updates on graffiti grapher
- Rename TimeStepAction to SprayCan, DrawingModule to ActionScript
- The drawing action now stops properly.
Links to the skateboarder and graffiti grapher pCSDT apps (using Java Web Start)
http://www.rpi.edu/~laut/SB/app.jnlp
http://www.rpi.edu/~laut/GG/app.jnlp
No comments:
Post a Comment