File: Camera

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 (43 lines) | stat: -rw-r--r-- 1,504 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
40
41
42
43
// Import the water molecule data
electrondensity = Import("watermolecule");

// Partition the data for parallelism
electrondensity = Partition(electrondensity);

// Create an isosurface at the value 0.3
isosurface = Isosurface(electrondensity,0.3);
box = ShowBox(isosurface);

// Create an orthographic camera. 
// The look-to point is [1 0 -1], the look-from point is
// [1 10 -1], the width of the field of view is 3 in user units, and the
// resolution of the image is 300 pixels. The "up" direction is the x axis.
camera = Camera([1, 0, -1], [1, 10, -1], width = 3, resolution = 300,
                 up = [1 0 0]); 

// Display the isosurface with the bounding box using the computed camera
collected = Collect(box,isosurface);
Display(collected,camera);

// Create a perspective camera. 
// The look-to point is [1 0 -1], the look-from point is
// [1 10 -1], the width of the field of view is 3 in user units, and the
// resolution of the image is 300 pixels. The "up" direction is the x axis.
camera = Camera([1, 0, -1], [1, 5, -1], resolution = 300,
                 up = [1 0 0], perspective=1, angle = 30); 

// Display the isosurface with the bounding box using the computed camera
Display(collected,camera);

// Create a perspective camera with a different angle. 
camera = Camera([1, 0, -1], [1, 5, -1], resolution = 300,
                 up = [1 0 0], perspective=1, angle = 70); 

// Display the isosurface with the bounding box using the computed camera
Display(collected,camera);