Re: Sphere v2 API discussion
Reply #83 –
I would think that Mode 2 should be the slowest, as it transforms and draws 1,000,000 vertices every frame. (The other 3 modes each draw just 4,000 vertices)
I can't understand why mode 1 would be slow though unless the slow down is from fiddling with the transformation matrix.
Modes 1 and 2 both do the below transformation actions for every ring every frame i.e. 1000 times per frame which Mode 0 doesn't have to do:
foo.matrix[1][0] = 3 * (Math.sin(rings[i].t * Math.PI/45) - Math.cos(rings[i].t * Math.PI/45)) / 8;
foo.matrix[1][1] = 0.5 - Math.sin(rings[i].t * Math.PI/45) - Math.cos(rings[i].t * Math.PI/45);
foo.matrix[1][2] = 3 * Math.cos(rings[i].t * Math.PI/45);
//...a few lines later
foo.translate(0, 50 * Math.cos(rings[i].t * Math.PI/100));