Making a Document that Generates 3D Objects
To create a document that generates 3D objects, all you need to do to get started is state that you are generating a 3D object in the document’s body. The Logic API will automatically handle the rest.
Step 1: Creating the document
As an example, let’s make a document than can generate simple 3D objects from text descriptions. To make this document that generates 3D objects, we can use the following content:Step 2: Testing this iteration of the document
Using thePreview
button, we can test this document to see if it works as expected. The document will generate a 3D object based on the text prompt provided.
For the first iteration of the document, we have a few issues. The document was able to generate a 3D object, but it was not able to return the object as a .obj file. Instead, it returned the object as a text string encoded in base64.
Once the base64 content is decoded and imported into a 3D viewer, I saw additional issues. The object was missing some faces, and had some other faces that were not visible, as they were facing the wrong direction. This is a common issue with 3D objects, and it can be fixed by flipping the normals of the object.