File: Unmark

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 (31 lines) | stat: -rw-r--r-- 1,008 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

    // Import the data
electrondensity = Import("watermolecule");
    // Partition the data
electrondensity = Partition(electrondensity);
    // Show the boundary of the data field, and add shading using the Normals
    // module
boundary = ShowBoundary(electrondensity);
boundary = Normals(boundary);
    // Create a camera
camera = AutoCamera(electrondensity,"off-diagonal");
    // Display the boundary
Display(boundary,camera);

    // Mark the positions of the original field. This puts the positions
    // into the data component so that we can operate on them
marked = Mark(electrondensity,"positions");
    // warp the positions using the Compute module
warped = Compute("[$0.x, $0.y+sin($0.x), $0.z]", marked);
    // Return the warped positions to the "positions" component
new = Unmark(warped,"positions");
    // Show the boundary of the new field, and add normals for shading
boundary = ShowBoundary(new);
boundary = Normals(boundary);
    // Display the result
Display(boundary,camera);