Fun Programming

Fun programming 152: Exporting 3D shapes as .obj files in Processing


Listen Later

This time we are taking the shape we created in episode 151 and exporting it as an .obj file. To achieve that we use the OBJExport Processing library. We also take a look at how to make code run only once even if it's inside the draw loop. That becomes useful to avoid exporting the .obj file over and over again. We only need the file once 😃

Processing by default offers a limited set of 3D primitives: only spheres and cubes. Other shapes you have to load or build yourself out of triangles calling vertex(), which probably means knowing a lot of math. To make it easier to generate and manipulate complex 3D shapes there are several libraries, for instance Toxiclibs (toxiclibs.org/) and HE_Mesh (hemesh.wblut.com/). In this tutorial I also show where you can find examples for exporting .obj files using both HE_Mesh and Toxiclibs.
In the next episode we will import the .obj file into Blender and render an image with realistic lights and shadows!

...more
View all episodesView all episodes
Download on the App Store

Fun ProgrammingBy