On Tue, Dec 2, 2014 at 7:03 PM, Jason Grout <[email protected]> wrote: > On 12/2/14, 9:59, Dan Drake wrote: >> >> On Mon, 01 Dec 2014 at 06:34PM -0800, William Stein wrote: >>> >>> That's a way to make a *static* image. I strongly suspect that is not >>> at all what Dan is asking for. He is probably asking for a way to >>> embed a dynamic image in a website, with some combination of >>> javascript, data, and a small library built on three.js. Doing this >>> is somewhere on my mental wish list, but is not available in SMC yet. >> >> >> Yeah, what I'd like is: >> >> 1. Do something with plot3d in Sage. >> 2. Get code for that particular scene with something like >> >> P.save(format='threejs') > > > You can get our sagecell json scenetree by calling the .scenetree_json() > method: > > s=sphere() > s.scenetree_json()
And you can see the SageMathCloud code to do the same by typing (in a terminal in any SMC project) open ~/.sagemathcloud/graphics.py and looking at the function graphics3d_to_jsonable. (Caveat: I don't necessarily like that function at all...) > > >> >> 3. In my web page (a reveal.js slide deck, actually), do: >> >> load three.js library >> start a three.js scene, using data saved from plot3d > > > The 3d rendering code is at > https://github.com/sagemath/sagecell/blob/master/static/3d.coffee, which is > a highly-modified version of William's original code. It's not stand-alone, > but it would be a start towards a stand-alone solution. I think it would be > really cool to have something like that available. > > three.js does have built-in loaders for some formats that Sage supports, > like the obj format, but it doesn't support everything Sage has to offer, if > I recall correctly. > > Thanks, > > Jason > > > > > > > -- > You received this message because you are subscribed to the Google Groups > "sage-support" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sage-support. > For more options, visit https://groups.google.com/d/optout. -- William Stein Professor of Mathematics University of Washington http://wstein.org -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/d/optout.
