Skip to content

Commit e8c067e

Browse files
committed
demos/test5.p to also show with no colours
1 parent 77b98c1 commit e8c067e

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

demos/test5.p

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ my @objs = (
2222
);
2323
my $i = 0;
2424
@objs = map mk_trid($i++, @$_), @objs;
25-
my ($below_obj, $above_obj) = map mk_trid($_, 'LineStrip'), -1, 0+@objs;
25+
my ($below_obj, undef, $above_obj) = map mk_trid($_, 'LineStrip'), -1, @objs/2;
2626

27-
sub mk_trid { "PDL::Graphics::TriD::$_[1]"->new($y+pdl(0,0,$_[0]),$c,$_[2]) }
27+
sub mk_trid {
28+
my $class = "PDL::Graphics::TriD::$_[1]";
29+
($class->new($y+pdl(0,0,$_[0]),$c,$_[2]),
30+
$class->new($y+pdl(0,0,$_[0]+0.5),undef,$_[2]));
31+
}
2832

2933
my $win = PDL::Graphics::TriD::get_current_window();
3034
my $g = PDL::Graphics::TriD::Graph->new;

lib/PDL/Demos/TriD1.pm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,7 @@ my @demo = (
169169
# The reason for the [] around $x,$y,$z:
170170
# 1. You can give all the coordinates and colors in one ndarray.
171171
$c = zeroes 3,$size+1;
172-
$coords =
173-
sin((3+3*xvals $c)*yvals $c);
174-
$colors = $coords;
172+
$colors = $coords = sin((3+3*xvals $c)*yvals $c);
175173
line3d $coords, $colors; # Draw a curved line, colored
176174
# (this works also for lattices, etc.)
177175
# [press 'q' in the graphics window when done]

0 commit comments

Comments
 (0)