7
use PDL::Graphics::TriD;
9
# After each graph, let the user rotate is and
10
# wait for him to press 'q', then make new graph
11
line3d($coords); # $coords = (3,n,...)
12
line3d($coords,$colors); # $colors = (3,n,...)
15
lattice3d([$x,$y,$z]); # 2-d piddles
18
hold3d(); # the following graphs are on top of each other and the previous
21
$pic = grabpic3d(); # Returns the picture in a (3,$x,$y) float piddle (0..1).
23
release3d(); # the next graph will again wipe out things.
7
use PDL::Graphics::TriD;
9
# After each graph, let the user rotate is and
10
# wait for him to press 'q', then make new graph
11
line3d($coords); # $coords = (3,n,...)
12
line3d($coords,$colors); # $colors = (3,n,...)
15
lattice3d([$x,$y,$z]); # 2-d piddles
18
hold3d(); # the following graphs are on top of each other and the previous
21
$pic = grabpic3d(); # Returns the picture in a (3,$x,$y) float piddle (0..1).
23
release3d(); # the next graph will again wipe out things.
37
37
With OpenGL, it is easy to manipulate the resulting 3D objects
38
38
with the mouse in real time - this helps data visualization a lot.
40
41
With VRML, you can generate objects for everyone to see with e.g.
41
42
Silicon Graphics' Cosmo Player. You can find out more about VRML
42
43
at C<http://vrml.sgi.com/> or C<http://www.vrml.org/>
61
62
OpenGL but off-line (pixmap) rendering and writing to
65
=item VRML (I< Not available this release >)
66
67
VRML objects rendering. This writes a VRML file describing the
67
68
scene. This VRML file can then be read with a browser.
94
95
The alternative syntaxes for specifying a set of coordinates (or colors) are
96
$piddle # MUST have 3 as first dim.
97
$piddle # MUST have 3 as first dim.
98
99
[$piddle1,$piddle2]
99
100
[$piddle1,$piddle2,$piddle3]
116
A 2-D lattice. [$piddle] is interpreted as the Z coordinate over
117
A 2-D lattice. C< [$piddle] > is interpreted as the Z coordinate over
117
118
a lattice over the first dimension. Equivalent to
118
[$piddle->xvals, $piddle->yvals, $piddle].
119
C< [$piddle->xvals, $piddle->yvals, $piddle] >.
122
A 2-D polar coordinate system. [$piddle] is interpreted as the
123
A 2-D polar coordinate system. C< [$piddle] > is interpreted as the
123
124
z coordinate over theta and r (theta = the first dimension of the piddle).
127
A set of colors. [$piddle] is interpreted as grayscale color
128
(equivalent to [$piddle,$piddle,$piddle]).
128
A set of colors. C< [$piddle] > is interpreted as grayscale color
129
(equivalent to C< [$piddle,$piddle,$piddle] >).
132
A line made of 1 or 2 coordinates. [$piddle] is interpreted as
133
[$piddle->xvals,$piddle,0]. [$piddle1,$piddle2] is interpreted as
134
[$piddle1,$piddle2,$piddle1->xvals].
133
A line made of 1 or 2 coordinates. C< [$piddle] > is interpreted as
134
C< [$piddle->xvals,$piddle,0] >. C< [$piddle1,$piddle2] > is interpreted as
135
C< [$piddle1,$piddle2,$piddle1->xvals] >.
143
144
you don't need to start thinking about where to plot the points:
145
points3d([SURF2D,$zcoords]);
146
points3d([SURF2D,$zcoords]);
147
148
will do exactly the same.
468
469
This is a special class: in order to obtain a new viewport, you
469
470
need to have an earlier viewport on hand. The usage is:
471
$new_vp = $old_vp->new_viewport($x0,$y0,$x1,$y1);
472
$new_vp = $old_vp->new_viewport($x0,$y0,$x1,$y1);
473
474
where $x0 etc are the coordinates of the upper left and lower right
474
475
corners of the new viewport inside the previous (relative
525
526
$dev ||= $::PDL::Graphics::TriD::device; # First, take it from this variable.
526
527
$dev ||= $::ENV{PDL_3D_DEVICE};
529
# warn "Default PDL 3D device is GL (OpenGL):
530
#Set PDL_3D_DEVICE=GL in your environment in order not to see this warning.
531
#You must have OpenGL or Mesa installed and the PDL::Graphics::OpenGL extension
532
#compiled. Otherwise you will get strange warnings.";
533
$dev = $^O =~ /win32/i ? "VRML" : "GL";
530
# warn "Default PDL 3D device is GL (OpenGL):
531
# Set PDL_3D_DEVICE=GL in your environment in order not to see this warning.
532
# You must have OpenGL or Mesa installed and the PDL::Graphics::OpenGL extension
533
# compiled. Otherwise you will get strange warnings.";
535
$dev = "GL"; # default GL works on all platforms now
536
538
# The following is just a sanity check.