Torus

Renanse got a class going that renders many shapes and we are currently in the middle of making classes for each of them. Torus is finished and in CVS. TestTorus will demo it.

Thanks for putting the real class together, Mojo… it will probably take a while to get all of the classes referenced in MeshUtils into their own classes, make noise about certain ones if you use them a lot.

Hey all, sort of an update on Torus…



Eric and I have been working on a PQTorus implementation. Eric did all the hard math work for the vertices and I put together normals and texture coords and did a little cleanup.



Check it out (a 5,3 PQTorus… See TestPQTorus):





I think Eric is working on a cool demo to show it animating between PQ states. Also, I’m thinking we may want to modifying how textures are applied to this and Torus (have it repeat every x degrees along the radial path.)

Yep, I’m working on the demo now. It is, unfortunately, exposing how slow our generation code really is! Specifically, the huge numbers vectors that need to be generated: 3 x 4096 for a PQ torus with a 128 steps and 32 radial samples. Also, the large amount of trigonometric math required. Hmm. I think there’s still room to eke out more speed…



Another thought regarding the test: I’ve decided to opt for GUI after becoming annoyed with our keyboard API. We seriously need a way for users to determine if a single key, or combination of keys, has been struck. Otherwise, checking for a key being depressed only, there might be several update frames across which the key is down. No good for certain types of input (i.e. the kind I need).

For key press, I have an idea for that that I implemented in my LWJGL game. Let me see if it could apply to our Keyboard impl.

Btw, we should try the fastsin and fastcos alternatives in the FastMath class to see if that speeds up PQ Torus generation while still giving acceptable results.

Using fastsin and fastcos from FastMath mangles the PQ torus beyond all recognition. Neither version creates a shape even remotely resembling a torus. Oh well, so much for that.

right, I’m going to kill those methods now, they do nothing for us.

added fasttrig methods proposed awhile back on the boards to FastMath. These methods use lookup tables and require some extra memory, but are dozens of times faster. (Eric, see the PQTorus demo again as an example.)

Looking great guys. A very cool effect.