[yt-users] quick rendering question

Sam Skillman samskillman at gmail.com
Wed May 4 06:34:06 PDT 2011


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> 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      **
> **  Dept. of Astronomy          203-432-5119                      **
> **  Yale University             www.astro.yale.edu/adavis   **
> *************************************************************
>
>
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20110504/80cb84d8/attachment.html>


More information about the yt-users mailing list