Ask Your Question

Revision history [back]

A better way to rotate a tachyon plot

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"? I know this much:

  1. I can write the coordinate transformation and apply it to each part of the plot, but it's tedious.
  2. There are camera_center and look_at parameters to the Tachyon object, but I don't see how I can use an implicit_plot3d together with the Tachyon object.
  3. I can use the trick from The tachyon object used for rendering plots in the following way:

.

sage: P = plot3d(f, (x,-2,2), (y,-2,2))
sage: opts = P._process_viewing_options({})
sage: T = P._prepare_for_tachyon(opts['frame'], opts['axes'], opts['frame_aspect_ratio'], opts['aspect_ratio'], opts['zoom'])
sage: S = T.tachyon().replace('resolution 400 400','resolution 800 800')\
         .replace('center  2.3 2.4 2.0', 'center  0.0 1.0 1.0')\
         .replace('viewdir  -2.3 -2.4 -2.0', 'viewdir  0.0 -1.4 -1.0')
sage: tachyon_rt(S)

The question: is there an easier way?

click to hide/show revision 2
simple answer => simple question

A better way to rotate a tachyon plot

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"? I know this much:

  1. I can write the coordinate transformation and apply it to each part of the plot, but it's tedious.
  2. There are camera_center and look_at parameters to the Tachyon object, but I don't see how I can use an implicit_plot3d together with the Tachyon object.
  3. I can use the trick from The tachyon object used for rendering plots in the following way:

.

sage: P = plot3d(f, (x,-2,2), (y,-2,2))
sage: opts = P._process_viewing_options({})
sage: T = P._prepare_for_tachyon(opts['frame'], opts['axes'], opts['frame_aspect_ratio'], opts['aspect_ratio'], opts['zoom'])
sage: S = T.tachyon().replace('resolution 400 400','resolution 800 800')\
         .replace('center  2.3 2.4 2.0', 'center  0.0 1.0 1.0')\
         .replace('viewdir  -2.3 -2.4 -2.0', 'viewdir  0.0 -1.4 -1.0')
sage: tachyon_rt(S)

The question: is there an easier way?position"?

A better way to rotate a tachyon plot

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"?