Following on from my previous post, I've improved the display and added the ability to rotate, zoom and translate the molecule.
The result is Minimol (should work with everything except Internet Explorer*).
Notes: The original Processing has support for 3D (spheres, OpenGL, and suchlike) but here I need to do all the leg work myself. The rotation doesn't work quite as it should (e.g. if you rotate 90 deg around the y axis, see what happens if you try to rotate around the x), so if you have some experience with this please get in touch. processing.js cannot draw ellipses, only circles - here is a patched version with support for ellipses.
* Internet Explorer doesn't support the Canvas tag (nor will the forthcoming IE8). I tried ExplorerCanvas, but it didn't help.
Amazing!
ReplyDeleteThanks Rich, but it has to be said that with processing.js looking after the technical side of things (events and suchlike), it made things a lot easier. I'm hoping that if I translate it into javascript, it will work okay on IE too. After all, it's only circles and lines.
ReplyDeleteMinimol... sounds like the evil Minime :)
ReplyDeleteAnyway, nice work!
Nice! A great technique for finding 3D rotations from mouse input is Ken Shoemake's ArcBall (Graphics Gems IV, i think). A nice tutorial can be found at http://viewport3d.com/trackball.htm
ReplyDeleteThanks for that Simon - I'll test it out.
ReplyDelete