Blog >

LightningCAD Reimagined: Applying Virtual and Augmented Reality

Theo Luciano

CCC Days

November 11, 2020

At RoleModel Software’s most recent CCC Days, one of the most fascinating and promising projects the team worked on was exploring AR (augmented reality) and VR (virtual reality) in conjunction with our signature LightningCAD software framework.

One of LightningCAD’s features is the ability to render a custom-designed model in 3D, which gives a user the ability to see and interact with a scaled, realistic representation of their work.

We’ve done some recent work with the Sayfa Group, an Australian company that produces fall safety platforms and accessories. The 3D capabilities are incredibly useful to them, showing a very clear picture of what is being produced and what it will look like in its final state. Those involved with the designs can manipulate their configuration as much as they need in the web-based setting.

Still, the possibilities were somewhat confined by dependence on a manufactured environment and an inability to actually get up close. It’s limited to panning, zooming, and dragging; a good start, but wouldn’t it be cool to see the model, exactly how it would appear, actually standing in front of you? What about the ability to walk around and even on the configuration?

Now it's possible

LightningCAD already renders the photorealistic 3D model. It was up to our developers to figure out how to transfer that into the XR space. (XR stands for Extended Reality, and it is a general term for alternate reality technologies, such as AR and VR.)

If you’re not familiar with the concept of virtual and augmented reality, here’s the breakdown.

A virtual reality environment is achieved by completely taking over your vision to give you the impression you’re somewhere else; an alternate, “virtual” reality. A headset is used to block out the presence of your actual surrounding, and whatever is showing on the screen inside the headset, whether it’s a movie, a game, or a LightningCAD 3D model, becomes all you can see. For this reason, VR is a far more immersive experience between the two.

Augmented reality, on the other hand, doesn’t seek to block out the real world; it simply adds to it. If you’re wanting to show a LightningCAD model, you could use a special viewer on your phone to display the model in your physical kitchen, virtually placing it on your coffee table. Amazon uses an AR view in their app so that you can see what a product will look like in your house before you buy it.

For virtual realistic viewing, we decided to use the Oculus Quest 2 headset to interact with our model. The Quest 2 is one of the most advanced all-in-one VR headsets available at the moment.
Augmented reality generally doesn’t require much for special hardware. We used an app called WebXR Viewer, created by Mozilla, and simply loaded it up on our phones.

With the hardware figured out, the team set to work adding VR/AR capabilities.
The software we wanted to experiment with was built primarily with JavaScript, so our developers have been using JavaScript’s 3D API, Three.js, to create their 3D objects within the software.
Getting the software to render 3D objects is one of the hardest parts. Since that was done, it was simply a matter of exposing the view of those objects in a different way, whether a headset or a smartphone.
Some of these basics are built into Three.js, so once we enabled those features and wrote some logic to place our model in the real world, it was time to test the result.

In the image above, you can see an example of a 3D model from our software being rendered in AR. This was shot on an iPhone. Notice how the structure appears in addition to people and objects that are also in view.

A bonus of keeping the “real world” involved is that you can move around your model and view it from different angles just by walking. With VR, there is mostly no reference to the physical world, meaning you need additional controls to navigate around the model.

This example is part of a Sayfa walkway viewed in VR. With the headset on, it’s as if you’re standing right next to the structure. As a user moves their head and looks around, the view changes as it would in the real world. The background is blank since we were focusing on the walkway configuration specifically, but there is certainly an option to populate it.

As was mentioned before, a shortcoming of VR is the difficulty to navigate around your design by traditional methods. If you take a physical step, you’ll move in VR, as long as the headset moves with you. The headset tracks movement fairly accurately. The problem is that you’re also taking a step in real life. The space in VR may be wide open, but putting on a headset won’t remove the actual wall standing in front of you.

Since there are some large structures that we wanted to render in VR, we knew there was an additional feature we wanted to enable with our experiment, and that was teleportation. Before you get visions of Star Trek and “Beam me up, Scotty!”, teleportation in VR works a bit differently.

The Oculus Quest 2, like most new headsets, includes two controllers, one for each hand. Once our team figured out the code they needed, they linked one of those controllers to a red circle that appears in the virtual environment.

By moving the circle to the desired location and then clicking a button on the controller, the viewer teleports to that location and the surroundings adjust accordingly, as you can see here.

The virtual ground we can cover with teleporting capabilities is endless. It doesn't matter how big a configuration is, we’ll be able to move around as much as we need.

By adding XR to our robust LightningCAD platform, clients will have another option when it comes to viewing their configuration, and it’s more true-to-life than ever before.

Since LightningCAD is a base framework that we customize for each client, any software piece built on it will have XR capabilities. The implementation of XR in LighningCAD will be a valuable addition and we look forward to watching the endless possibilities in the future for RoleModel Software. In fact, we’re excited to showcase these options early next year in some of the applications we’re currently building.

Stay tuned!