- Creating common 3D shapes using 3D pen
Here are some example shapes created from the above codelets:
A "knot" codelet is intended to be used for a 3D version of the knitting application (http://community.csdt.rpi.edu/projects/38/). For the detailed parameter usage of the knit codelet, please refer to this interactive example (http://www.smartjava.org/ltjs/chapter-05/08-basic-3d-geometries-torus-knot.html).
Currently, stampled shapes take over the following properties from a 3D sprite (in above example, a bird): color, position, rotation, scale, and texture. Thus, if you want to change those properties for shapes created from 3D pen, first you can apply 3D operations to the 3D sprite and then stamp any shapes you want.
Using the arc codelet, we can develop a VirtualWigwam application as follows:
Hereby we achieved the goal we set in the beginning of the summer!
- 3D shape display control for speed up the rendering
- 1st step: rendering 1st arc
- 2nd step: rendering 1st and 2nd arcs
- 3rd step: rendering 1st, 2nd, and 3rd arcs
- Nth step: rendering 1st, 2nd, ..., and Nth arcs
Thus, it costs you N*(N+1)/2 times of rendering the arc. This is unavoidable because if we change anything in the 3D space and make it visible, we need to request Three.js to update the entire canvas for 3D. Three.js might be doing something intelligent to avoid rendering the same objects over and over again, but at least the above sequence is what we request from the application's perspective.
Having said that, if we do not need to display intermediate results from the 1st - N-1th renderings, we can just skip these steps and display the Nth result only. Based on that idea, I have implemented a "hide pen" and a "show pen" codelets, which stops and resumes rendering 3D shapes by 3D pen.
Using these codelets just as the following, the system just renders arcs N times, not N*(N+1)/2 times.
arc width: 100 height: 100
- Switching codelets depending on if the sprite is 2D or 3D
On the other hand, when a 3D sprite is selected the same palette looks as follows:
- Concluding remarks
I have been really enjoying this project and am reasonably happy for the achievements I made including the VirtualWigwam.
Hope someone takes over my work and further enhances this project!