- 3D Costumes
- Keep the original dimension of 3D costumes
- Scale the dimension of 3D costumes to fit a specific-sized canvas
Currently, the size of the stage is (360, 480); however, available 3D objects do not always fit to this size. So, it seems to me that option 2 looks reasonable at this point. Moreover, we can change the size of 3D objects by the "change size by X" block.
I choose (160, 160) as the dimension of a canvas for 3D costumes on the stage. To find appropriate scaling factor to fit this canvas, I used the idea described this Q & A page. As a result, a general 3D costume loading function is successfully implemented as follows:
In this figure, spheres are called bounding spheres and are displayed for debugging purpose. No matter how we rotate the 3D objects, they stay inside the spheres. I implemented these sphere to be scaled to fit the (160, 160) canvas.
- 2D rotation still does not work properly. The size of the canvas gets bigger depending on the rotation.
- Nesting for 3D operations are not implemented yet. 2D operations seem to work.