File: Render

package info (click to toggle)
dxsamples 4.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 26,340 kB
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,102
file content (42 lines) | stat: -rw-r--r-- 1,491 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
     // 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);
     // Create four camera, looking at the isosurface from four different
     // directions
camera1 = AutoCamera(isosurface,"front",resolution=320);
camera2 = AutoCamera(isosurface,"top",resolution=320);
camera3 = AutoCamera(isosurface,"left",resolution=320);
camera4 = AutoCamera(isosurface,"diagonal",resolution=320);


      // Create four images, using the four cameras
image1 = Render(isosurface,camera1);
image2 = Render(isosurface,camera2);
image3 = Render(isosurface,camera3);
image4 = Render(isosurface,camera4);

      // Collect the four images together, and arrange them 2 to a row
object = Collect(image1,image2,image3,image4);
arranged = Arrange(object,2);
      // Display the result
Display(arranged);

      // Create a new camera
camera = AutoCamera(isosurface);
      // Create a new image using the new camera
image = Render(isosurface,camera);
      // Display the image
Display(image);
      // Filter the image using the laplacian filter
filtered = Filter(image,"laplacian","colors");
      // Display the result
Display(filtered);


// NOTE: unless you are planning to manipulate the image as we have done
// in these examples, it is usually more efficient to use the Display
// module alone, as in
//        Display(object,camera);