Skip to main content

Making an Agent that Generates 3D Objects

To create an agent that generates 3D objects, all you need to do to get started is state that you are generating a 3D object in the agent’s body. The Logic API will automatically handle the rest. 3d demo

Step 1: Creating the agent

As an example, let’s make an agent that can generate simple 3D objects from text descriptions. To make this agent that generates 3D objects, we can use the following content:

Step 2: Testing this iteration of the agent

Using the Preview button, we can test this agent to see if it works as expected. The agent will generate a 3D object based on the text prompt provided. For the first iteration of the agent, we have a few issues. The agent 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.

Step 3: Improving the agent

To improve the agent, we can add more specific instructions to the agent’s body. For example, we can specify that we want the agent to return the object as the text contents of an .obj file, and that we want the agent to make sure all faces are visible and facing the right direction. To do this, we need to offer a few more details in the agent’s body. I added a description of the .OBJ file format, and a few details about how the direction of the faces are handled in the .OBJ file format.

Step 4: Testing this New Iteration of the Agent

With all of these updates, the agent was able to generate a 3D object based on the text prompt provided. The agent returned the object as the text contents of a simple .obj file, and all faces were visible and facing the right direction.

Conclusion

In conclusion, creating an agent that creates a 3D object is easy with the Logic API. By simply stating that you want to generate a 3D object in the agent’s body, the Logic API will automatically handle the rest. You can correct and improve the agent by adding more specific instructions to the agent’s body. This will help the Logic API understand what you want the output to look like, and how to fix any issues you run into. Now, you can publish your agent and begin using the API to generate simple 3D objects.