6/03/2014

Week of 5/28/2014 - 6/3/2014

  • 3D Costumes
I have been working on "real 3D costumes" this week. By "real 3D costumes", I mean you can load arbitrary 3D objects from three.js-compatible JSON files. Here are some examples of those JSON files: Walt Disney and Suzanne.

As suggested by Prof. Eglash, I added the following menu for loading 3D costumes:

Once you load 3D costumes from the newly added 3D Costumes menu, sprites on the stage look as follows:

  • 3D Rotation (Turn)
3D Objects can be rotated around X, Y, and Z axes as depicted in the following figure.The Z-axis is not really visible on the stage, but logically it is there as if it is coming towards you.


To rotate objects in 3D, the following blocks are added this time. Names of the blocks are tentative (please let me know if you come up with a good one).
    • 3D turn: This block is used to turn the object gradually. That is, it adds the specified parameters to the current object's degrees.
 
    • 3D point: Unlike the 3D turn, this block rotate the object to point absolute degrees in the 3D space.

Here is an example of rotated objects:



  • Github repository
The source code implementing these 3D functions can be found at:
  https://github.com/imais/Snap--Build-Your-Own-Blocks
Please note this is highly experimental, so use it at your own risk.

  • Issues
    • When rendering 3D objects, scaling factors are chosen to fit a 120 by 120 canvas. We need to figure out a way to properly scale and project 3D objects on the 2D stage.
    • 2D rotation does not work properly. The size of the canvas gets bigger depending on the rotation.

No comments:

Post a Comment