[Studio] Importing three.js/Rendering custom three.js meshes without url?

Hello! :grin:

(Optional) Context

I am working on an application which allows students to visualize Calculus graphs (paraboloids, spheres, etc) in AR using the Studio API. The current version of our app utilizes CortexJS Compute Engine to individually calculate points, which are represented by sphere primitives, but as you can imagine the load time is quite slow and non conducive to AR. Currently I am researching the Parametric Geometry addon for 3js to achieve this same goal while cutting load times, specifically following Stemkoski’s graphulus function (cannot add more than 2 links but should be googlable!) example. Alternatively, I will look into an implementation of the marching cubes algorithm (Stemkoski has another good example in the same repo).
If anyone who happens to see this has insight into how to best approach this, feel free to share!

Main Questions

Three.js

I can’t find much documentation for threejs integration with the Studio API. The closest is here, but I could not figure out how to import the three namespace in the same way ecs can be imported. Unfortunately, the Studio API does not give devs access to any of the html files, so I cannot do imports in the header.
Moreover, even if I were to import it, I can’t find whether addons are supported through this integration. My current solution was to bring the three.core.js and ParametricGeometry files into my project directory, but of course this is clunky. So is there a more elegant way to complete these imports?

Custom Meshes

The output from ParametricGeometry is of type ParametricGeometry which extends BufferGeometry. I am wondering how this can be displayed using the Studio API? The closest I could find was importing custom models, but it seems like this requires the model to be hosted at an external URL rather than created within the app. Again, the three.js examples I can find for 8th wall do not use the Studio API, so I am a little lost and don’t doubt the possibility that I could be missing something obvious!

You might consider using the Legacy Editor and vanilla three.js/8th Wall rather than Studio for this specific use-case.

Here are the steps to create a Legacy Editor project: Create Legacy Editor Project | 8th Wall .

You can check out this project which shows how to load addons with recent versions of three.js: three.js: 3D model | Evan Carlson | 8th Wall

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.