When I first got the Vision Pro on Friday, one of my favorite first experiences was the dinosaur demo. Getting a chance to see 3D models up close in such high resolution gives a sense of depth and intuitiveness I’ve never experienced before.
Over the weekend I knew I wanted to do a project that leveraged 3D assets, but I am not an expert 3D designer so I knew I wasn’t going to be able to build all the necessary models in just a couple of days. Instead, I turned to my favorite video game growing up: Minecraft. Minecraft’s world generation did all of the heavy lifting of creating fascinating 3D models. All I had to do was write a script to convert world files into USDZ’s and build a visionOS app to showcase the awesome depth and detail in the models.
Currently, the workflow for converting Minecraft worlds is simple:
convert_world.sh
to turn the world into a USDZ fileWorldEntity+Configuration.swift
To create this conversion script, I relied on two main software packages.
The conversion script provides all the necessary parameters for Jmc2Obj and usdzconvert to generate crisp Minecraft models with the correct material properties to look as they do in the game.
The app itself consists of two views: a window showing all available world models and a volume where you can interact with the models themselves.
As you can see above, the window embeds each model in a custom-built carousel letting you either tap on worlds to select them or scroll through and snap to whichever one you are looking at. Whenever you are ready to choose your world, clicking View World brings up a volume for you to inspect the environment.
You can position the model wherever you want as well as use the spatial drag gesture to rotate the world around its Y axis. If you select a different world in the window, the volume will update to the new one while still maintaining its orientation.
DragRotationModifier.swift
file adapted from the HelloWorld tutorial)CarouselView.swift
from the ground up.