- Playing with Three.js
- Displaying a 3D cube on the stage of C-Snap
- Added a new "stamp cube" codelet, which calls "doStampCube" function.
- Copied the "doStamp" function in object.js and named it "doStampCube", and then replaced context.drawImage() with three.js commands to draw a 3D cube. Also, added a step function to constantly render the cube for animation (thanks to suggestions from Charles & Libby!!).
It looks good in a sense that the green 3D cube keeps rotating; however, as soon as you move the Sprite (the arrow-head shaped object), the animation stops as follows:
In this figure, the left half of the cube keeps rotating, but not the right half. This means that the area around the Sprite is subject to update, but not the other area. This is a reasonable behavior considering the fact that stamp is designed for still images.
At this point, I don't know if I should try to resolve this issue with option #1 or start working on option #2. I will keep looking both options for now.