~ubuntu-branches/ubuntu/lucid/pdl/lucid

« back to all changes in this revision

Viewing changes to Demos/TriD/tvrml2.p

  • Committer: Bazaar Package Importer
  • Author(s): Ben Gertzfield
  • Date: 2002-04-08 18:47:16 UTC
  • Revision ID: james.westby@ubuntu.com-20020408184716-0hf64dc96kin3htp
Tags: upstream-2.3.2
ImportĀ upstreamĀ versionĀ 2.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
BEGIN { $PDL::Graphics::TriD::device = "VRML"; }
 
2
BEGIN{
 
3
  PDL::Graphics::VRMLNode->import();
 
4
  PDL::Graphics::VRMLProto->import();
 
5
}
 
6
use PDL::Graphics::TriD;
 
7
use PDL::LiteF;
 
8
use Carp;
 
9
 
 
10
$SIG{__DIE__} = sub {print Carp::longmess(@_); die;};
 
11
$set = tridsettings();
 
12
$set->browser_com('netscape/unix');
 
13
#$set->set(Compress => 1);
 
14
 
 
15
$nx = 20;
 
16
 
 
17
$t =  (xvals zeroes $nx+1,$nx+1)/$nx;
 
18
$u =  (yvals zeroes $nx+1,$nx+1)/$nx;
 
19
 
 
20
$x = sin($u*15 + $t * 3)/2+0.5 + 5*($t-0.5)**2;
 
21
$cx = PDL->zeroes(3,$nx+1,$nx+1);
 
22
random($cx->inplace);
 
23
$pdl = PDL->zeroes(3,20);
 
24
$pdl->inplace->random;
 
25
$cols = PDL->zeroes(3,20);
 
26
$cols->inplace->random;
 
27
 
 
28
$g = PDL::Graphics::TriD::get_new_graph;
 
29
$name = $g->add_dataseries(new PDL::Graphics::TriD::Points($pdl,$cols));
 
30
$g->bind_default($name);
 
31
$name = $g->add_dataseries(new PDL::Graphics::TriD::Lattice([SURF2D,$x]));
 
32
$g->bind_default($name);
 
33
$name = $g->add_dataseries(new PDL::Graphics::TriD::SLattice_S([SURF2D,$x+1],$cx,
 
34
                                                     {Smooth=>1,Lines=>0}));
 
35
$g->bind_default($name);
 
36
$g->scalethings();
 
37
$win = PDL::Graphics::TriD::get_current_window();
 
38
 
 
39
 
 
40
require PDL::Graphics::VRML::Protos;
 
41
PDL::Graphics::VRML::Protos->import();
 
42
 
 
43
 
 
44
#$win->{VRMLTop}->register_proto(PDL::Graphics::VRML::Protos::PDLBlockText10());
 
45
 
 
46
 
 
47
#$win->{VRMLTop}->uses('PDLBlockText10');
 
48
 
 
49
 
 
50
 
 
51
#$win->current_viewport()->add_object(new PDL::Graphics::TriD::VRMLObject(
 
52
#                                                                                                                                         vrn(Transform,
 
53
#                                                                                                                                                       translation => '0 0 -1',
 
54
#                                                                                                                                                       children =>
 
55
#                                                                                                                                                       [new PDL::Graphics::VRMLNode('PDLBlockText10')
 
56
#                                                                                                                                                       ]
 
57
#                                                                                                                                                 )
 
58
#                                                                                                                                        ));
 
59
 
 
60
 
 
61
 
 
62
 
 
63
$win->display('netscape');
 
64
exit;