Re: [canvas-developers] spinning 3-d models with mouse
- Hi Paul,
I'll fire things up in a profiler this weekend and see whether that
reveals anything; I'll let you know. What version of Firefox were
you testing in?
On 8/25/06, Paul A Houle <ph18@...> wrote:
> I've got a version of polyhedra.org that lets people spin models
> with the mouse, see
> It's not ready to go into production. It depends on the browser
> and the computer, but I really don't feel in control when I try to spin
> models with more than about 30 faces.
> I don't think I can get the frame rate up much more. I haven't
> done profiling lately, but when I last did it, I found I was spending
> about 50% of my time doing math and about 50% doing drawing on
> Mozilla. One big optimization is that I'm culling backfaces; I can't
> imagine that I can do much more to speed up the drawing.
> I think, on the other hand, there are things I can do to make
> users feel more "in control" even if the frame rate is low.
> I really need to look at the details of how the event handling
> works and how redraws are triggered, particularly on IE.
> I'm doing the rotations in a dumb way now. Right now I look at
> the motion in the x and y direction and rotate the object proportionately
> along two difference axes, one after the other. This works OK when the
> frame rate is high, so the rotations are small, but it doesn't feel right
> when the rotations are large because of the noncommutativity of the
> rotation operators. I think I can do better by finding an axis that is
> perpendicular to the line the mouse moved in, and doing a rotation along
> that axis: the straightforward way to do this involves composing three
> rotation operators into a single rotation matrix.
> I also notice the animations are jittery on Mozilla. The rotation
> will be smooth, and then it will stop for a moment. Often this kind of
> thing happens when memory allocation or garbage collection kicks in. So
> far I've been making new Array()'s whenever it's convenient, but I'm
> thinking of going to a more FORTRAN-style of preallocating my arrays.
> Any thoughts?