/[escript]/trunk/pyvisi/py_src/examples/seriesofcutsoffline.py
ViewVC logotype

Contents of /trunk/pyvisi/py_src/examples/seriesofcutsoffline.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 963 - (show annotations)
Tue Feb 13 04:05:13 2007 UTC (12 years, 2 months ago) by jongui
File MIME type: text/x-python
File size: 986 byte(s)
Added more examples and on-the-fly animation.
1 from esys.pyvisi import Scene, DataCollector, MapOnPlaneCut, Camera
2 from esys.pyvisi.constant import *
3
4 s = Scene(renderer = Renderer.OFFLINE_JPG, num_viewport = 1, x_size = 1152,
5 y_size = 864)
6
7 # Create two data collector instances.
8 dc1 = DataCollector(source = Source.XML)
9
10 dc1.setFileName(file_name =
11 "/home/jongui/trunk/pyvisi/test/python/data_data/interior_3D.xml")
12
13 # NOTE: There is a difference between performing rotation then followed by
14 # translation and performing translation then followed by rotation.
15
16 # Create a map on plane cut instance for the first viewport.
17 mopc1 = MapOnPlaneCut(scene = s, data_collector = dc1,
18 viewport = Viewport.SOUTH_WEST)
19 mopc1.setPlaneToYZ(0.1)
20
21 c1 = Camera(scene = s, data_collector = dc1, viewport = Viewport.SOUTH_WEST)
22 c1.isometricView()
23
24 # Generate multiple images from the tranlsation.
25 for i in range(0, 30):
26 print "Generating image", i
27 s.saveImage("output/%04d.jpg" % i)
28 mopc1.translate(0.1,0,0)

  ViewVC Help
Powered by ViewVC 1.1.26