I've been trying to make animations of Tachyon raytraced 3d plots, so
that people can see a plot from multiple angles without java. (It
could also be used to visualise a forth dimension...) None of my
attempts have worked....
The best strategy I've had was:
sage: b = parametric_plot3d((u^2, v, u*v), [u, -1, 1], [v, -1, 1],
viewer='tachyon')
sage: animate([b.rotateY( 2*pi*(j/6) ) for j in range(6)])
But that didn't work either... I seem to be over my head in the
internal magic of sage. Can someone help me?
Thanks,
Christopher
Animate doesn't understand 3d graphics objects. This shouldn't be too
hard to fix, is anyone working on that?
- Robert
The problem is that I'm having trouble geting that list. I'm trying to
use Tachyon to render images, but... It's not working very well.
> --
> To post to this group, send email to sage-s...@googlegroups.com
> To unsubscribe from this group, send email to
> sage-support...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-support
> URL: http://www.sagemath.org
>
My guess is that since http://trac.sagemath.org/sage_trac/ticket/2872
has been merged, the above code will work in sage 4.3.3. Does anyone
have an alpha they can try it in? You might have to fiddle with the
viewer='tachyon' bit, though.
Thanks,
Jason
-Marshall Hampton
On Feb 17, 2:33 pm, Christopher Olah <christopherolah...@gmail.com>
wrote:
> I think you misunderstand. I'm not passing a 3d object to animate (or
> at least, I'm not trying to...). I'm passing a list of images of a 3d
> object.
>
> The problem is that I'm having trouble geting that list. I'm trying to
> use Tachyon to render images, but... It's not working very well.
>
> On Wed, Feb 17, 2010 at 1:52 PM, Robert Bradshaw
>
Someone might be interested in reviewing #7298: use html5 video tag for
animations:
"The attached patch adds support for creating Ogg Theora videos from
animation objects.
The resulting video files are embedded into the notebook using the html5
video tag. "
Thanks,
Jason
-Marshall
Sure.
TIA,
A. Jorge Garcia
http://calcpage.tripod.com
Teacher & Professor
Applied Mathematics, Physics & Computer Science
Baldwin Senior High School & Nassau Community College
def tachbs(p, th = .2, fade = 1.0, xres = 500, yres = 500, **kwds):
c_center = [2*max([q[i] for q in p.vertices()]) for i in range(3)]
c_center[0],c_center[1] = c_center[0]*cos(th)+c_center[1]*sin(th),-
c_center[0]*sin(th)+c_center[1]*cos(th)
t = Tachyon(xres = xres, yres = yres, camera_center = c_center,
**kwds)
lightc = [x for x in c_center]
lightc[2] += 5
t.light(lightc,.5,(1.0,0.0,1.0))
t.texture('mattered',color = (1.0,0,0), ambient = .2*fade, opacity
= 1.0*fade, diffuse = .8*fade)
t.texture('matteblue',color = (0,0,1.0), ambient = .2*fade,
opacity = 1.0*fade, diffuse = .8*fade)
for q in p.vertices():
t.sphere(q,.05,'mattered')
for q in p.vertex_adjacencies():
q1 = q[0]
for q2 in q[1]:
t.fcylinder(p.vertices()[q1], p.vertices()[q2], .01,
'matteblue')
return t
def makeblackframe(fname, xres = 500, yres = 500):
t = Tachyon(xres = xres, yres = yres)
t.save(fname)
pico = polytopes.icosahedron()
prelabel = 'demo'
npi = RDF(pi)
frames = 120
for i in srange(0,frames):
if mod(i,20)==0: print i
fname = prelabel + '0'*(3-len(str(i)))+str(i)
tachbs(pico,th = 2.0*npi*i/(frames-1.0), antialiasing=True,
raydepth = 6).save(DATA+fname+'.png')
makeblackframe(DATA+ prelabel + '0'*(3-len(str(i+1)))+str(i+1)
+'.png')
os.system('ffmpeg -qmax 2 -r 20 -i ' + DATA + prelabel + '%3d.png ./'
+ prelabel +'.mp4')
-Marshall
On Mar 3, 11:08 am, Christopher Olah <christopherolah...@gmail.com>
wrote:
You could use the python formatting magic:
sage: "%03d"%1
'001'
sage: "%03d"%11
'011'
sage: "%03d"%199
'199'
sage: "%03d"%1999
'1999'
See http://docs.python.org/library/stdtypes.html#string-formatting for
more options.
Thanks,
Jason
> BTW, tachyon is supposed to run over MPI. Can I use SAGE to run
> tachyon over a cluster?
Sage just calls the tachyon executable, so if you (re)compile tachyon
with MPI support it might just work. Of course if you're doing an
animation it's trivial to parallelize the individual frames (though
you might run out of memory before you run out of CPU in that case).
- Robert
-Marshall
On Mar 4, 2:50 am, Robert Bradshaw <rober...@math.washington.edu>
wrote: