Math::Zap

Zap 3d objects drawn in 2d with lighting and shadowing.

Copyright Philip R Brenan, 2004

This package supplies functions and operators to draw and zap object in 3d space:

#!perl -w #______________________________________________________________________ # Draw cube floating against triangular corner in 3d with shadows. #______________________________________________________________________

use draw; use color; use cube; use triangle; use vector;

#______________________________________________________________________ # Draw this set of objects. #______________________________________________________________________

draw ->from (vector( 10, 10, 10)) ->to (vector( 0, 0, 0)) ->horizon (vector( 1, 0.5, 0)) ->light (vector( 20, 30, -20))

    ->object(triangle(vector( 0,  0,  0), vector( 8,  0,  0), vector( 0,  8,  0)),                         'red')
    ->object(triangle(vector( 0,  0,  0), vector( 0,  0,  8), vector( 0,  8,  0)),                         'green')
    ->object(triangle(vector( 0,  0,  0), vector(12,  0,  0), vector( 0,  0, 12)) - vector(2.5,  0,  2.5), 'blue')
    ->object(triangle(vector( 0,  0,  0), vector( 8,  0,  0), vector( 0, -8,  0)),                         'pink')
    ->object(triangle(vector( 0,  0,  0), vector( 0,  0,  8), vector( 0, -8,  0)),                         'orange')
    ->object(cube::unit()*2+vector(3,5,1), 'lightblue')

->done;

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

This is alpha code. It is written in pure Perl. It uses the standard Perl install mechanism.

Download Math-Zap-1.02.tar.gz from CPAN, untar and:

  perl Makefile.PL
  make
  make test
  make install

If you are on Windows, use nmake, available at:

http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe

Zapping is used in Nuclear Fusion Experiments to determine the power incident on an object placed in the path of a high energy particle beam.

Help with this project would be appreciated.

For bug reports or suggestions please send email to: philiprbrenan@yahoo.com