test4.p (PDL-2.077) | : | test4.p (PDL-2.078) | ||
---|---|---|---|---|
use blib; | ||||
use Carp; | ||||
$SIG{__DIE__} = sub {die Carp::longmess(@_);}; | ||||
use PDL; | use PDL; | |||
use PDL::Graphics::TriD; | use PDL::Graphics::TriD; | |||
use PDL::Graphics::TriD::Image; | use PDL::Graphics::TriD::Image; | |||
use PDL::IO::Pic; | use PDL::IO::Pic; | |||
$s = 10; | $s = 10; | |||
$k = zeroes($s,$s); | $k = zeroes($s,$s); | |||
$x = $k->xvals(); | $x = $k->xvals(); | |||
random($k->inplace); $x += $k; | random($k->inplace); $x += $k; | |||
$y = $k->yvals(); | $y = $k->yvals(); | |||
random($k->inplace); $y += $k; | random($k->inplace); $y += $k; | |||
random($k->inplace); | random($k->inplace); | |||
$z = $k; | $z = $k; | |||
$x /= $s; $y /= $s; $z /= $s; | $x /= $s; $y /= $s; $z /= $s; | |||
$x = new PDL::Graphics::TriD::Lattice([$x,$y,$z]); | $pa = PDL::Graphics::TriD::Lattice->new([$x,$y,$z]); | |||
$y = new PDL::Graphics::TriD::Points([$x,$y,$z+1]); | $pb = PDL::Graphics::TriD::Points->new([$x,$y,$z+1]); | |||
$win = PDL::Graphics::TriD::get_current_window(); | $win = PDL::Graphics::TriD::get_current_window(); | |||
$win->clear_objects(); | $win->clear_objects(); | |||
$win->add_object($x); | $win->add_object($pa); | |||
$win->add_object($y); | $win->add_object($pb); | |||
$PDL::Graphics::TriD::verbose //= 0; | ||||
#$win->twiddle(); | ||||
#exit; | ||||
$nx = zeroes(3,20); | $nx = zeroes(3,20); | |||
$nc = zeroes(3,20); | $nc = zeroes(3,20); | |||
random($nx->inplace); | random($nx->inplace); | |||
random($nc->inplace); | random($nc->inplace); | |||
print "NX: $nx, NC: $nc\n"; | ||||
use PDL::Graphics::OpenGL; | use OpenGL qw(:all); | |||
# glShadeModel (&GL_FLAT); | ||||
glShadeModel (&GL_SMOOTH); | glShadeModel (&GL_SMOOTH); | |||
$lb = $win->glpRasterFont("5x8",0,255); | $lb = $win->glpRasterFont("5x8",0,255); | |||
print "LIST: $lb\n"; | $win->add_object(TOBJ->new); | |||
$win->add_object(new TOBJ()); | ||||
$win->twiddle(); | $win->twiddle(); | |||
package TOBJ; | package TOBJ; | |||
BEGIN{@TOBJ::ISA = qw/PDL::Graphics::TriD::Object/;} | our @ISA; BEGIN { @ISA = qw/PDL::Graphics::TriD::Object/ } | |||
use PDL::Graphics::OpenGLQ; | use PDL::Graphics::OpenGLQ; | |||
use PDL::Graphics::OpenGL; | ||||
sub new { | sub new { | |||
bless {},$_[0]; | bless {},$_[0]; | |||
} | } | |||
sub togl { | sub togl { | |||
glDisable(&GL_LIGHTING); | OpenGL::glDisable(&OpenGL::GL_LIGHTING); | |||
line_3x_3c( | PDL::gl_line_strip_col($::nx,$::nc); | |||
# $::x->slice("0:2"),$::y->slice("0:2") | OpenGL::glColor3f(1,0,1); | |||
$::nx,$::nc | gl_texts(PDL->pdl(0,0,0.5), OpenGL::GLUT::done_glutInit(), | |||
); | $::lb, ["HELLO HELLO HELLO GLWORLD!!!"]); | |||
glColor3f(1,0,1); | OpenGL::glEnable(&OpenGL::GL_LIGHTING); | |||
glRasterPos3f(0,0,0.5); | ||||
PDL::Graphics::OpenGL::glpPrintString($::lb,"HELLO HELLO HELLO GLWORLD!!! | ||||
"); | ||||
glEnable(&GL_LIGHTING); | ||||
} | } | |||
End of changes. 9 change blocks. | ||||
32 lines changed or deleted | 13 lines changed or added |