On Dec 3, 2007 8:44 PM, Nils Bruin <[EMAIL PROTECTED]> wrote: > > OK, I finally found some instructions that looked halfway trustworthy. > > https://java3d.dev.java.net/binary-builds.html > > has a readme for 1.5.1 that had relatively easy to follow > instructions. These actually worked! I've been able to view the little > "capeman" in a "java applet window" (I guess it doesn't do inlining in > the web page yet?) > > In order to save people the trouble next time, I'll put an easily > found search string here: > > In order to get Java3d working with sage in your browser, you have to > install the Java3d extension that can be found on "https:// > java3d.dev.java.net/binary-builds.html". Follow the instructions in > the README posted there to install the Java3d extension in your local > java installation. > > After that, the following actually works: > > sage: from sage.plot.plot3d.shapes import * > sage: from sage.plot.plot3d.plot3d import plot3d > sage: S = Sphere(.5, color='yellow') > sage: S += Cone(.5, .5, color='red').translate(0,0,.3) > sage: S += Sphere(.1, color='white').translate(.45,-.1,.15) + Sphere(. > 05, color='black').translate(.51,-.1,.17) > sage: S += Sphere(.1, color='white').translate(.45, .1,.15) + Sphere(. > 05, color='black').translate(.51, .1,.17) > sage: S += Sphere(.1, color='yellow').translate(.5, 0, -.2) > sage: def f(x,y): return math.exp(x/5)*math.cos(y) > sage: P = plot3d(f,(-5,5),(-5,5), ['red','yellow'], max_depth=10) > sage: cape_man = P.scale(.2)+S.translate(1,0,0) > sage: cape_man.show() >
Thanks for posting what you had to do and persevering! I had only used OSX where things just automatically worked without any additional steps, so I didn't know the issues, evidently. By the way, try this: sage: from sage.plot.plot3d.shapes import * sage: from sage.plot.plot3d.plot3d import plot3d sage: S = Sphere(.5, color='yellow') sage: S += Cone(.5, .5, color='red').translate(0,0,.3) sage: S += Sphere(.1, color='white').translate(.45,-.1,.15) + Sphere(.05, color='black').translate(.51,-.1,.17) sage: S += Sphere(.1, color='white').translate(.45, .1,.15) + Sphere(.05, color='black').translate(.51, .1,.17) sage: S += Sphere(.1, color='yellow').translate(.5, 0, -.2) sage: def f(x,y): return math.exp(x/5)*math.cos(y) sage: P = plot3d(f,(-5,5),(-5,5), ['red','yellow'], max_depth=10) sage: cape_man = P.scale(.2)+S.translate(1,0,0) sage: foo = Sphere(.5, color='yellow') sage: for i in range(10): foo += cape_man.translate(randint(0,5),randint(0,5),randint(0,5)) sage: foo.show() You'll get a whole fleet of caped men. At least on my machine once they appear maximize the window -- then rotate around -- it feels very snappy. Here is a nice test of rotating lots of spheres all at once: sage: from sage.plot.plot3d.shapes import * sage: from sage.plot.plot3d.plot3d import plot3d sage: S = Sphere(.5, color='yellow') sage: for i in range(200): S += Sphere(.45, color='red').translate(randint(-5,5),randint(-5,5),randint(-5,5)) sage: S.show() Again, on my machine at least it feels very fast. It's this sort of robustness and speed even for complicated scenes that I think is critical to success. William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---