[yt-users] quick rendering question
Cameron Hummels
chummels at astro.columbia.edu
Wed May 4 09:35:18 PDT 2011
Andrew,
In addition to the steady_north parameter in the camera command, there
is an north_vector parameter, so you can explicitly set what you want
your viewing orientation to be. I use that to good effect in the
rotate-around-your-object animations. Good luck!
Cameron
On 05/04/2011 09:34 AM, Sam Skillman wrote:
> Hi Andrew,
>
> I have seen this before, and my recollection was that it was solved by
> first moving to the Camera interface for volume renderings, which is
> documented here:
>
> http://yt.enzotools.org/doc/visualizing/volume_rendering.html#the-camera-interface
>
> and here:
>
> http://yt.enzotools.org/doc/reference/api/generated/yt.visualization.volume_rendering.camera.Camera.html#yt.visualization.volume_rendering.camera.Camera
>
> and by then using the keyword steady_north=True in the Camera object
> initialization. This attempts to keep the "up" orientation constant
> while moving the camera during rotations, translations, etc. This may
> not be necessary, but I have found it useful.
>
> I will also note that there are other benefits to using the Camera
> interface, such as access to the Camera.rotation(theta, n_steps,
> rot_vector=None) function, which returns a series of n_steps snapshots
> rotating through an angle of theta. Here the optional "rot_vector"
> can be used to specify the vector about which you want to rotate, but
> if none is specified then it uses the current north vector, which is
> probably what you want.
>
> Let us know if this helps!
>
> Best,
> Sam
>
> On Wed, May 4, 2011 at 9:14 AM, Andrew Davis <andrew.davis at yale.edu
> <mailto:andrew.davis at yale.edu>> wrote:
>
> Hi folks,
>
> I'm doing some simple volume rendering, with the end goal to make
> a movie looking at the central object from a bunch of different
> angles (just going around in a circle). When I do the script
> below, some of the images are rotated 90 degrees from the others
> -- that is, the correct viewing direction, but just rotated
> clockwise 90 degrees. Any thoughts why that would be happening?
>
> Cheers,
>
> Andrew
>
> tf=ColorTransferFunction((mi,ma))
> tf.add_layers(6,w=0.02)
> v,c=pf.h.find_max("Density")
> W = 0.01/pf['pc']
> Nvec=512
> for i in range(200):
> dy=4.*math.pi/199.
> theta = i * dy
> yval = math.cos(theta)
> xval = math.sin(theta)
> L=[xval,yval,0.]
> vp=pf.h.volume_rendering(L,W,c,Nvec,tf,whole_box=True)
> vp.ray_cast()
> write_bitmap(vp.image,"VolTest_%03d.png" % i)
>
> *************************************************************
> ** Andrew J. Davis andrew.davis at yale.edu
> <mailto:andrew.davis at yale.edu> **
> ** Dept. of Astronomy 203-432-5119 <tel:203-432-5119>
> **
> ** Yale University www.astro.yale.edu/adavis
> <http://www.astro.yale.edu/adavis> **
> *************************************************************
>
>
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org <mailto:yt-users at lists.spacepope.org>
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
--
Cameron Hummels
PhD Candidate, Astronomy Department of Columbia University
Public Outreach Director, Astronomy Department of Columbia University
NASA IYA New York State Student Ambassador
http://outreach.astro.columbia.edu
PGP: 0x06F886E3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20110504/d92581d3/attachment.html>
More information about the yt-users
mailing list