Alex -

Thanks for the quick reply. Soon after the post I stumbled on the SimulationCell object and then things started to make sense to me.

In case its useful to readers, I post below a short snippet below which effectively rotates the view around the z-axis and captures a series of frames of the scene that can then be post-processed into an animation (with say, ImageMagick or your favorite movie-making tool).

Best,

Peter

--------------------------------------------------------------------------------------------------------

.... setup your scene ...

node.add_to_scene()

node.compute()

vp = Viewport(

type = Viewport.Type.PERSPECTIVE,

fov = (1.0)

)

rs = RenderSettings(

size = (640,640),

background_color = (0.0,0.0,0.0)

)

# boxorigin is defined as center of simulation cell (in whatever coordinates of the input frame)

# use this as focus point around which camera viewport will pan

cell = node.source.cell

x0 = cell.matrix[:,3]

xlat = cell.matrix[:,0]

ylat = cell.matrix[:,1]

zlat = cell.matrix[:,2]

boxorigin = numpy.add(x0, 0.5*xlat)

boxorigin = numpy.add(boxorigin, 0.5*ylat)

boxorigin = numpy.add(boxorigin, 0.5*zlat)

# camera will circle an orbit a distance rorbit - defined in increments of 1/2 the box length

# (assuming a cubic cell domain here)

# otherwise better to take increment as the max length among cell dimensions.

nincr = 4

rorbit = nincr*numpy.linalg.norm(0.5*xlat)

# position camera over sequence to rotate around z-axis and render images

nframes = 120

for i in range(0,nframes) :

rs.filename = 'image_' + str(i).zfill(5) + '.png'

theta = float(i)*2.0*3.14159/float(nframes)

px = rorbit*math.cos(theta)

py = rorbit*math.sin(theta)

pz = 0.0

dx = -(px-boxorigin[0])

dy = -(py-boxorigin[1])

dz = -(pz-boxorigin[2])

vp.camera_pos = (px,py,pz)

vp.camera_dir = (dx,dy,dz)

vp.render(rs)

--------------------------------------------------------------------------------------------------------