On Fri, Jan 27, 2012 at 1:25 AM, William Stein <wst...@gmail.com> wrote: > On Fri, Jan 27, 2012 at 1:10 AM, mmarco <mma...@unizar.es> wrote: >> I have just tested on chromium and firefor under linux. It does work >> on both (but i have the impression that performance is better in >> chromium). Strangely, it does work on the version of firefox that i >> have compiled in my computer, but it doesn't in the binary version >> from the firefox site. I guess that there is some compile option that >> is disabled in the binary package. > > Hi, > > I just looked at WebGL and other options for a while, and though WebGL > is neat and "the future", etc., it is almost the farthest thing > possible from "just working". It's the exact opposite of what I > think the Sage notebook desperately needs (and which JMOL does *not* > provide despite its promise), which is rock solid 3d graphics that > just work everywhere (except Internet Explorer, where Sage barely > works anyways). Of course, having WebGL support will be amazing > for high-performance applications, e.g, as an alternative to VTK. > But it doesn't work on my cell phone. > > I had hoped that Bill Cauchois's canvas3d rendered (that is in Sage) > would fill this void, but it is still a very basic wireframe renderer, > and isn't very useful in practice. At least it works on everything > that supports HTML5 canvas 2d. > > I found another newer 3d library called Pre3d [1]. This is a 3d > javascript library that uses HTML5 canvas 2d, which is the same thing > that Rado's graph editor uses (and Cauchois's library), and works on > iphones, android tablets, firefox, chrome, safari, etc. It does > hidden surface removal and transparency. Having looked through the > code, I think a library based on Pre3d could be the best *default* for > 3d graphics for Sage. It obviously doesn't look as good as jmol, but > it is very lightweight, uses little memory, loads quickly, doesn't > crash, works on my phone, etc. It will have to be extended to do > what we want, e.g., it does not currently support text, but that > should be easy given that canvas2d has excellent text support. > > [1] http://deanm.github.com/pre3d/ > > Any thoughts? > > We would also have to write javascript code that could parse a 3d > scene described using some JSON representation, draw the scene, etc. > It would also be critical to add some sort of selector support to > pre3d (which has none). At least manipulating the scene is > straightforward javascript, so it should be easier to integrate more > tightly with Sage than JMOL is.
Right after looking at pre3d and sending this, I found via google search another library called three.js [1]. This simultaneously supports *both* HTML5 canvas2d and webgl (if available), so it is blazingly fast on my laptop (say), but at least works on my iphone and Android tablet, and anything else with HTML5 canvas. It also supports selecting individual objects in a 3d scene and moving them around, e.g., [2] (uses webgl). Canvas for complicated scenes is of course slow, but at least it works on nearly anything. Switching from jmol to three.js as our main engine for 3d graphics should be high on the roadmap for this year. [1] http://mrdoob.github.com/three.js/ [2] http://mrdoob.github.com/three.js/examples/webgl_interactive_draggablecubes.html -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org