# A way to rotate a tachyon plot

 2 I can rotate a plot3d using the Java viewer, and then take an image. I'd like to use tachyon, but then how do I choose the right angle to take the picture? I'd like to rotate the whole plot, or in other words, "place the camera in an arbitrary position"? asked Jun 02 '11 pang 177 ● 4 ● 11 http://www.uam.es/persona...

 5 Does the .rotate() method do what you want? Compare the output of: sage: var('x,y') (x, y) sage: P = plot3d(sin(x*y), (x,-2,2), (y,-2,2)) sage: Q = P.rotate((0,0,1),pi/4) sage: P.show(viewer='tachyon') sage: Q.show(viewer='tachyon')  posted Jun 02 '11 niles 3605 ● 7 ● 45 ● 101 http://nilesjohnson.net/ I can't believe I didn't see that one! I'll edit the question so that it's less confusing... but it wasn't a waste: I'll use the Tachyon stuff anyway. pang (Jun 02 '11) While this isn't my thread, I'd like to thank the poster: this totally answers a question I was wondering about. StevenPollack (Aug 13 '11)
 1 Another option is the sage.plot.plot3d.tachyon.Tachyon interface (which is imported into the global namespace by default). Basically, you create a Tachyon scene instance, setup the contents of the scene, then render. Here is a slightly modified example from the Tachyon docstring: sage: t = Tachyon(xres=512,yres=512, camera_center=(3,0.3,0), look_at=(0,0,0), updir=(0,0,1)) sage: t.light((4,3,2), 0.2, (1,1,1)) sage: t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1.0,0,0)) sage: t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.3, opacity=1.0, color=(0,1.0,0)) sage: t.texture('t2', ambient=0.2,diffuse=0.7, specular=0.5, opacity=0.7, color=(0,0,1.0)) sage: k=0 sage: for i in srange(-1,1,0.05): ... k += 1 ... t.sphere((i,i^2-0.5,i^3), 0.1, 't%s'%(k%3)) ... sage: t.show()  The key here is the first line--the arguments camera_center, look_at, and updir, which are quite self-explanatory. The only problem with this mechanism is that you must directly use Tachyon's methods to construct objects instead of Sage's usual plotting interfaces. (Graphics3d, plot3d, parametric_plot3d, etc.) posted Jun 02 '11 Kelvin Li 443 ● 10 ● 17 That didn't work for me because I had several implicit_plot_3d. I was able to use a trick from http://ask.sagemath.org/question/20/the-tachyon-object-used-for-rendering-plots, but it was very verbose and a bit hacky. Thanks anyway, this might work for somebody else. pang (Jun 07 '11)
 0 Unfortunately the rotate() method didn't work for my implicit_plot3d plot. It seems a bit strange. Why not making the additional options such as camera_center available via the show() method? There are some "extra_opts" parameter in show() method, but it is not clear how to use it and whether it is actually possible to pass the camera_center parameter through it. posted Aug 13 '11 v_2e 219 ● 1 ● 12 ● 30

[hide preview]