WebGL is an emerging standard for doing hardware-accelerated 3D
graphics directly in the browser (no plugins). Firefox 4 beta 1 and
the latest version of Chrome both support it on Linux, OSX, and
Windows, if you have sufficiently good OpenGL support. (People are
working on a Direct3D backend for use in the web browsers; hopefully
in a few months, WebGL will work on Windows without OpenGL.) For both
Firefox and Chrome, you need to explicitly enable WebGL; see the above
link for details.
I'm excited about WebGL; I think it has promise to be the primary Sage
graphics interface in the notebook (although not this year, and maybe
not next year).
My current code is buggy, ugly, and limited. I plan to keep working
on it (well, basically rewrite it from scratch); if people are
interested in collaborating, let me know.
I'm sending this email to both sage-notebook and sage-devel.
Presumably any technical discussion should be on sage-notebook.
Carl
Note -- you need Chromium on OS X, not Chrome: "The way the Chrome
developers currently recommend you get WebGL in Chrome is to use a
nightly build of Chromium, the open source browser on which Chrome is
based."
> Windows, if you have sufficiently good OpenGL support. (People are
> working on a Direct3D backend for use in the web browsers; hopefully
> in a few months, WebGL will work on Windows without OpenGL.) For both
> Firefox and Chrome, you need to explicitly enable WebGL; see the above
> link for details.
>
> I'm excited about WebGL; I think it has promise to be the primary Sage
> graphics interface in the notebook (although not this year, and maybe
> not next year).
>
> My current code is buggy, ugly, and limited. I plan to keep working
> on it (well, basically rewrite it from scratch); if people are
> interested in collaborating, let me know.
>
> I'm sending this email to both sage-notebook and sage-devel.
> Presumably any technical discussion should be on sage-notebook.
>
> Carl
>
--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
I am extremely excited about WebGL as well. A few months ago, I started
discussing things with the person that developed WebGLot
(http://dan.lecocq.us/wordpress/tag/webglot/), but our discussions are
stalled while he is investigating getting permission from his university
to release the code.
I currently investigate WebGL code using the OSX version of the WebKit
Nightly:
(see the instructions on http://learningwebgl.com/blog/?p=11 that cwitty
pointed out)
(hmm...except for some reason, I seem to be getting errors
Carl: have you seen the sympy OpenGL plotting code?
>
> My current code is buggy, ugly, and limited. I plan to keep working
> on it (well, basically rewrite it from scratch); if people are
> interested in collaborating, let me know.
Definitely interested in at least keeping tabs on it, and depending on
my time, helping with it. I'd also love to get some students involved
in it too.
I should note that we should also test the practically-finished changes
that Jonathan Gutow has made to the JMOL interface in Sage. The changes
polish a lot of things in the JMOL interface, and we will likely have
the JMOL interface for a long time, especially for browsers/computers
that don't support webgl.
Thanks,
Jason
> (hmm...except for some reason, I seem to be getting errors
>
I mentioned the error on IRC, and Carl fixed it in about 2 minutes. It
looks great in the webkit nightly now!
Thanks,
Jason
There was a bug in the GLSL code (that runs on the graphics card). My
nvidia driver is evidently more forgiving than Jason's driver.
> Carl: have you seen the sympy OpenGL plotting code?
I haven't looked at it recently.
I think the first step is to get a solid plot3d backend, so all I need
to do is display triangles (and, ideally, lines, points, and text) --
Sage does all the plotting.
> Definitely interested in at least keeping tabs on it, and depending on my
> time, helping with it. I'd also love to get some students involved in it
> too.
I spent the day looking at Javascript scene graph libraries.
Hopefully a good library will let us get the plot3d backend done
quickly and move on the the fun stuff, like plotting directly in the
browser (so some interactive things can happen without the server
round-trip).
My current favorite is SceneJS.
(I'm talking to Jason on IRC right now about how to work together.)
Carl
My current plan is to rewrite it using SceneJS (scenejs.org), and
support the complete list of plot3d primitives (IndexFaceSet, Point,
Line, Text). Then axes should work.
I don't think this will take very long (days or weeks, not months).
Carl
this is awesome, what you did! It actually does something for me
(unlike the jmol, that never really worked for me). I use the latest
google chrome in ubuntu karmic. I start it with
google-chrome --enable-webgl
and I can see one triangle. I run William's movie and in there I can
see a nice surface plot. So I can't see that, but just the fact, that
I can see some 3D things is a progress. I have spent a day trying to
get this running on my linux about two months ago and just gave up (I
tried both firefox and chrome and chromium).
More below:
On Mon, Jul 19, 2010 at 10:54 PM, Carl Witty <carl....@gmail.com> wrote:
> On Mon, Jul 19, 2010 at 10:19 PM, Jason Grout
> <jason...@creativetrax.com> wrote:
>> (hmm...except for some reason, I seem to be getting errors)
>
> There was a bug in the GLSL code (that runs on the graphics card). My
> nvidia driver is evidently more forgiving than Jason's driver.
>
>> Carl: have you seen the sympy OpenGL plotting code?
>
> I haven't looked at it recently.
We use pyglet, so I think that is not so useful for the browser,
unless you mean something else.
I would love to use just some gui in the browser.
>
> I think the first step is to get a solid plot3d backend, so all I need
> to do is display triangles (and, ideally, lines, points, and text) --
> Sage does all the plotting.
>
>> Definitely interested in at least keeping tabs on it, and depending on my
>> time, helping with it. I'd also love to get some students involved in it
>> too.
>
> I spent the day looking at Javascript scene graph libraries.
> Hopefully a good library will let us get the plot3d backend done
> quickly and move on the the fun stuff, like plotting directly in the
> browser (so some interactive things can happen without the server
> round-trip).
>
> My current favorite is SceneJS.
>
> (I'm talking to Jason on IRC right now about how to work together.)
It'd be cool to have some python library that people could use in
their projects, if it's not so much more work. I guess if it's going
to be part of the notebook, then that should be ok.
SceneJS looks cool.
Ondrej
Have you tried --no-sandbox? Evidently that works around some bugs
for some people. (I haven't needed to try it myself.) You could also
try Firefox 4 beta 1.
> More below:
>
> On Mon, Jul 19, 2010 at 10:54 PM, Carl Witty <carl....@gmail.com> wrote:
>> On Mon, Jul 19, 2010 at 10:19 PM, Jason Grout
>> <jason...@creativetrax.com> wrote:
>>> Carl: have you seen the sympy OpenGL plotting code?
>>
>> I haven't looked at it recently.
>
> We use pyglet, so I think that is not so useful for the browser,
> unless you mean something else.
Well, for the next stage, I'll be using Sage's plotting, so sympy
isn't relevant.
It's possible that in the future, I would try to improve the look of
Sage's plots; and I do like the look of sympy's default plots (pastel
colors, no lighting, axes always visible). I would be looking at
sympy more as a source of inspiration than direct implementation tips.
> I would love to use just some gui in the browser.
I didn't understand this sentence.
> It'd be cool to have some python library that people could use in
> their projects, if it's not so much more work. I guess if it's going
> to be part of the notebook, then that should be ok.
Well, my tentative plan is to write a Javascript library that takes a
JSON encoding of Sage's plot3d primitives (IndexFaceSet, Point, Line,
Text) and displays it. The only Python code I plan to write is a
small addition to sage.plot.plot3d to add an easy-to-process JSON
encoding. If other people wanted to use the library, they would only
need to produce the JSON encoding for their data structures. I don't
think there's much point in a 3D-JSON-encoding library; it would be as
much work to translate into the library's format as it would be to
translate to JSON directly.
Carl
I wanted to say that I would much prefer to get rid of our custom
pyglet based plotting and just use a 3D plotting based on your library
and just use a browser for interacting with the plot.
>
>> It'd be cool to have some python library that people could use in
>> their projects, if it's not so much more work. I guess if it's going
>> to be part of the notebook, then that should be ok.
>
> Well, my tentative plan is to write a Javascript library that takes a
> JSON encoding of Sage's plot3d primitives (IndexFaceSet, Point, Line,
> Text) and displays it. The only Python code I plan to write is a
> small addition to sage.plot.plot3d to add an easy-to-process JSON
> encoding. If other people wanted to use the library, they would only
> need to produce the JSON encoding for their data structures. I don't
> think there's much point in a 3D-JSON-encoding library; it would be as
> much work to translate into the library's format as it would be to
> translate to JSON directly.
Yes, definitely. That's a good plan.
Ondrej
I am running Ubuntu Karmic and I am attaching a screenshot what
happens if I use plot3d in Chrome. A new window pops up with some
java, but the applet never loads and in a while the page crashes. Here
are the java packages that I have installed:
waj ondrej@crow:~$ wajig list java
ii ca-certificates-java 20090928
Common CA certificates (JKS
keystore)
ii java-common
0.30ubuntu5 Base of all Java
packages
ii libaccess-bridge-java
1.26.2-1ubuntu1 Java Access Bridge
for GNOME
ii libaccess-bridge-java-jni
1.26.2-1ubuntu1 Java Access Bridge
for GNOME (jni bindings)
ii libecj-java
3.5.1-0ubuntu1 Eclipse Java compiler
(library)
ii libecj-java-gcj
3.5.1-0ubuntu1 Eclipse Java compiler
(native library)
ii libequinox-osgi-java
3.5.1+repack~1-0ubuntu4 Equinox OSGi
framework
ii libjaxp1.3-java
1.3.04-5ubuntu2 Java XML parser and
transformer APIs (DOM, S
ii libjline-java
0.9.94-5~ubuntu1 Java library for
handling console input
ii libswt-gtk-3.5-java
3.5.1+repack~1-0ubuntu4 Standard Widget
Toolkit for Java, GTK+ versi
ii libxerces2-java
2.9.1-4ubuntu1 Validating XML parser
for Java with DOM leve
ii tzdata-java
2010j-0ubuntu0.9.10 time zone and
daylight-saving time data for
rc gjdoc 0.7.9-4.1
documentation generation
framework for java
rc libantlr-java-gcj
2.7.7-11ubuntu2 language tool for
constructing recognizers,
rc libjaxp1.3-java-gcj
1.3.04-5ubuntu2 Java XML parser and
transformer APIs (DOM, S
rc liblog4j1.2-java-gcj
1.2.15-4ubuntu1 Logging library for
java (native code)
rc libxerces2-java-gcj
2.9.1-4ubuntu1 Validating XML parser
for Java with DOM leve
If you can tell me which package exactly I should install to make this
work, that'd be awesome.
Ondrej
Ok, I am installing sun-java6-jre, from multiverse, which means it's
not an opensource software, so I had to agree to some licence that I
don't agree with, for example I had to agree with:
"
you do not combine, configure or distribute
the Software to run in conjunction with any additional software
that implements the same or similar functionality or APIs as the
Software;
"
and bunch of things like this. Btw, I just violated the licence by
combining their software with other java software that I have on my
laptop....
But now it works! Wow, it's pretty impressive, it's fast.
But as I said, I am not going to violate their licence, so I just
removed the java package from my system.
Ondrej
I wouldn't use that either and I'm using openjdk-6-jre / -jdk /-...
and the icedtea6-plugin ("web browser plugin based on OpenJDK and
IcedTea to execute Java applets") which is in my eyes the way that
should be recommended on ubuntu & similar.
H
Yes, those are the packages that I already have installed:
ondrej@crow:~$ wajig list jdk
ii openjdk-6-jdk
6b18-1.8-4ubuntu3~9.10.2 OpenJDK Development
Kit (JDK)
ii openjdk-6-jre
6b18-1.8-4ubuntu3~9.10.2 OpenJDK Java runtime,
using Hotspot JIT
ii openjdk-6-jre-headless
6b18-1.8-4ubuntu3~9.10.2 OpenJDK Java runtime,
using Hotspot JIT (hea
ii openjdk-6-jre-lib
6b18-1.8-4ubuntu3~9.10.2 OpenJDK Java runtime
(architecture independe
ondrej@crow:~$ wajig list iced
ii icedtea-6-jre-cacao
6b18-1.8-4ubuntu3~9.10.2 Alternative JVM for
OpenJDK, using Cacao
ii icedtea6-plugin
6b18-1.8-4ubuntu3~9.10.2 web browser plugin
based on OpenJDK and Iced
And this produces that screenshot that I posted. It doesn't work.
It has never worked for me. I think I have actually reported this
problem to both jmol and Debian before and the conclusion was that
Debian/Ubuntu guys told me that jmol is broken and jmol guys told me
that the openjdk in Debian is broken and doesn't support something.
But anyway, I am giving up on java and I'll wait for opengl.
Ondrej