Canvatorium Recap Three
Labs 010, 012–016 with a focus on Behaviors, Gizmos, and Ref History.
Preview version of Canvatorium is now live
Toward the end of this week, I took some time to host a development build of the Canvatorium project. You can find it on Vercel. Use the sidebar on the left to navigate to various labs. Each lab contains a canvas for the 3D scene and some notes. As always, you can find the code on GitHub. I encourage you to try out the labs in VR. If you have feedback or suggestions, please contact me on Twitter or use the contact form on this site.
Lab 010 – Updated Grab Examples
I added a few more examples of grabbing objects to Lab 010. Examples include:
- Mesh Picking to attach a mesh to the controller while holding the trigger
- SixDofDragBehavior – this is my favorite by far!
- Pointer Drag along a single axis
- Pointer Drag along a plane
Lab 012 – Gizmos!
Babylon JS has a ton of built-in 3D gizmos for working with 3D objects. I was pleasantly surprised that these work in VR when using pointer controls. This lab has a manual gizmo example, as well as an example that uses Gizmo Manager with multiple objects.
Lab 014 – Follow Behavior
Follow Behavior is an abstract behavior that can make an object follow a camera around a scene. The Near Menu from Lab 008 uses this behavior.
Lab 015 – Resizable GUI
This one took some work. I have an advanced dynamic texture on a plane, with the plane attached to card (box mesh). The card has a scale widget that lets the user resize it. After each resize, the GUI redraws to take advantage of this new size of the card. This example uses a single text block inside a scroll view, but this could be used with other containers such as grids and stacks.
Lab 016 – Snapping and History
This lab has an example of useRefHistory()
from VueUse. It has a box with a drag gizmo, snapping enabled. On each snap, the current position is saved to the ref. Then we can use undo and redo actions to cycle through the history of the ref data.
Bonus: I made a cheesey montage video of the first few weeks of Canvatorium development.