Transformations issues

It isn’t quite that it ignores them entirely. It is that the coordinate space for the vertex data is based on the transformation matrix when you write “beginShape().”

If you want a torus as a connected mesh, some good approaches are:

  1. use the equation for a torus, and compute the mesh coordinates without using translate / rotate – use sin/cos instead. This is how the processing.org Toroid example does it, using QUAD_STRIP for a square mesh. https://processing.org/examples/toroid.html

  2. use the Shapes 3D library – it has some really great tools for this.
    http://www.lagers.org.uk/s3d4p/index.html@quark also has a much older tutorial on creating a toroid class http://lagers.org.uk/javafx/toroidclass.html

2 Likes