I ran across this example of doing 3D using processing.js:
although it also uses web2py. I thought it was interesting
given the various problems with jmol at times.
Cheers,
Tim.
---
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo
http://www.linkedin.com/in/timlahey
Wow, this is impressive. It works nice, but it is too choppy on my
laptop (and I have a fast laptop now). Jmol is very smooth.
My own horse is probably http://code.google.com/apis/o3d/, but we'll
still have to wait some time for it.
Ondrej
But then I tried the chromium browser (linux build) and it was
absolutely smooth!
So it's just that Firefox's javascript interpreter is too slow for that.
Ondrej
It's perfectly smooth with Safari 4 on OS X and I'm using a base model
MacBook from June 2008 (so it's before the Nvidia graphics).
The problem with o3d is that it requires a plug-in and it only runs on
Mac and Windows.
I wonder how Firefox 3.5 does with this demo. If it does well, then it's
just Opera and IE that could pose problems.
Cheers,
Tim.
Surprisingly enough, Firefox 3.5 does worse thatn Firefox 3.0 on my
Ubuntu Jaunty (it is about the same choppy and it reacts in weird way
on the mouse). I am having some development version of Firefox 3.5, so
it may improve in the future. But as I said, Chromium is perfectly
smooth.
Ondrej
Interesting. I thought it was supposed to have faster Javascript. One
of the reasons I like the processing.js method is that it should work
on browsers such as mobile Safari. Testing that site in mobile Safari
on my 1st gen iPod Touch, it loads, but it doesn't seem to pass dragging
to the javascript so I can't rotate. However, it at least loads.
> While googling around I found this: http://groups.google.com/group/canvas-3d
> along with http://www.c3dl.org/ which actually looks just as promising
> as the google's solution.
The problem with both of those is that they both require extensions
and in
particular, Firefox. I like the javascript-python solution since it
doesn't
require any browser additions.
You should be able to find code for a virtual trackball to solve the
problem you're
having. It should still work in javascript since I've done it on
fairly slow machines.
http://image.diku.dk/research/trackballs/index.html
I've used Bell's Trackball that's described on that page. There is
code there that
should be able to be converted to javascript.
I haven't tested the patch since I haven't upgraded my version of Sage yet.
I'll look into this, thanks!
Definitely! I mean, the linked example is implemented using canvas
after all. I think there are many areas where we could make the Sage
notebook more interactive using HTML canvas and clientside JavaScript.
For anyone interested in this technology, there is an excellent
tutorial available at the Mozilla Developer Center
<https://developer.mozilla.org/en/Canvas_tutorial>.
> Rob
After you've applied the patch to your Sage repository, you should
launch the notebook and specify the keyword viewer='canvas3d' with a
3D plot (currently only plots created by the plot3d() command will
work).
Here's an example, from my comment on the ticket:
{{{
x, y = var('x y')
plot3d(sin(pi*(x^2+y^2))/2,(x,-1,1),(y,-1,1), viewer='canvas3d',
plot_points=(20, 20))
}}}
If G is a 3D plot, then G.show(viewer='canvas3d') will also work.
I hope that helps!
-- Bill
I think I found your problem. The URL you specified points to the HTML
formatted diff that is displayed by default. If you scroll to the
bottom of that page, there's a link for "Download in other formats:
Original Format" -- the URL you want is actually
<http://trac.sagemath.org/sage_trac/raw-attachment/ticket/6447/trac_6447-canvas3d.patch>.
> Is there a section in the documentation that tells about applying
> patches, and related things?
The only relevant section I could find
<http://sagemath.org/doc/developer/producing_patches.html> describes
the opposite of what you want to do. You might want to read the bit
about branches though, if you're not familiar with that feature
already. You should run "sage -clone canvas3d" to create a new branch
and THEN import the patch, so you don't inadvertently modify the main,
stable Sage branch.
Cheers,
Bill
It sounds like you haven't built sage (sage -b) before rerunning it.
You might also try (from a fresh sage!) "sage -merge 6447", which
should download, import, build, and test for you.
Nick