I've been trying to make a simple sketch that draws a parameterized 3D supershape, but am having a hard time actually making the 3D surface render correctly. I think I've got the math correct - I started with
this cool 2D example from Form+Code, then extended it into 3D using
these tips from Paul Bourke (with a few ControlP5 sliders to play with the variables).
What I ended up with is a small point cloud of seemingly ordered points. One can easily see the shape of the 3D form, so I think that part is working OK. However, I wanted to create a 3D model out of these points by connecting each of the vertices together with either a triangle strip or a quad strip. Trouble is, every time I try to do so, the result is extremely jagged, with tons and tons of overlapping and criss-crossing.
My investigation so far tells me that the points as they exist in my data structure (ArrayList) do not match up with the intuitive picture you see when you run the app (i.e., points that appear close to each other in the app running are not close together in the data structure).
I was hoping to end up with a model that I could export as an STL file for some 3D printing fun, but I'm stuck with making the model out of these points. Does anyone have any ideas?
If you'd like to view the code, I've posted it in a public Gist here:
https://gist.github.com/2625168
You will need the PeasyCam and ControlP5 libraries.
1