File: AutoCamera

package info (click to toggle)
dxsamples 4.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 26,348 kB
  • ctags: 1,513
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,101
file content (39 lines) | stat: -rw-r--r-- 1,545 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Import the data
electrondensity = Import("watermolecule");
// Partition the data
electrondensity = Partition(electrondensity);
// Create an isosurface at a value of 0.3
isosurface = Isosurface(electrondensity,0.3);
box = ShowBox(isosurface);
collected = Collect(box,isosurface);


// create a camera looking out roughly along the [1 1 1] direction.
// The aspect ratio is 1, and the resolution is 300 pixels
// Display the isosurface using this camera
camera = AutoCamera(isosurface,"off-diagonal",resolution = 300, aspect = 1);
Display(collected,camera);


// create a camera looking out along the y direction.
// The aspect ratio is 0.5, and the resolution is 300 pixels
// Display the isosurface using this camera
camera = AutoCamera(isosurface,"top",resolution = 300, aspect = 0.5);
Display(collected,camera);

// create a camera looking out along the z direction.
// The aspect ratio is 0.5, and the resolution is 300 pixels
// Change the up direction of the camera so that the "x" direction is up
// Display the isosurface using this camera
camera = AutoCamera(isosurface,"front",resolution = 300, aspect = 0.5, 
    up=[1 0 0]);
Display(collected,camera);

// create a perspective camera looking out along the z direction.
// The aspect ratio is 0.5, and the resolution is 300 pixels
// Change the up direction of the camera so that the "x" direction is up
// Display the isosurface using this camera
camera = AutoCamera(isosurface,"front",resolution = 300, aspect = 0.5, 
    up=[1 0 0], perspective = 1);
Display(collected,camera);