File: Replace

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 (20 lines) | stat: -rw-r--r-- 780 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

    // Import the data
electrondensity = Import("watermolecule");
    // Partition the data
electrondensity = Partition(electrondensity);
    // Create a camera
camera = AutoCamera(electrondensity,"off-diagonal");
    // Create a plane through the data
plane = MapToPlane(electrondensity,[1 0 -0.9]);
    // Compute the cube root of the electrondensity on the plane
rtdensity = Compute("$0^0.3333",plane);
    // Color based on the cube root
colored = AutoColor(rtdensity);
    // Replace the original data into the plane
originaldata = Replace(plane, colored);
    // Use RubberSheet to displace the plane according to the original data
displaced = RubberSheet(originaldata);
    // Add normals for shading and display
displaced = Normals(displaced);
Display(displaced,camera);