Draw 3D objects in 2D

This package supplies methods to draw a scene, containing three dimensional objects, as a two dimensional image, using lighting and shadowing to assist the human observer in reconstructing the original three dimensional scene.

Example zap.pl

`````` #!perl -w
#______________________________________________________________________
# Draw triangles with shadows in 3d
# PhilipRBrenan@yahoo.com, 2004.
#______________________________________________________________________

use Math::Zap::Draw;
use Math::Zap::Cube unit=>'cu';
use Math::Zap::Triangle;
use Math::Zap::Vector;

#_ Draw _______________________________________________________________
# 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(cu()*2+vector(3,5,1), 'lightblue')

->done;
``````

See directory eg for further examples.

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

# INSTALL

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

``````  perl Makefile.PL
make
make test
make install``````

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

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

# TO DO

Help with this project would be appreciated, expecially in the following areas:

Optimization

Cylinders, spheres, torii

Integration of incident power

More object types

Lighting effects

Textures for each plane
{"ft_lang_label":"__label__en","ft_lang_prob":0.5577776,"math_prob":0.9896055,"size":2159,"snap":"2019-51-2020-05","text_gpt3_token_len":634,"char_repetition_ratio":0.27935034,"word_repetition_ratio":0.09157509,"special_character_ratio":0.42102826,"punctuation_ratio":0.2711111,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.97989637,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-11T23:08:41Z\",\"WARC-Record-ID\":\"<urn:uuid:cabc1021-6bd6-41db-9595-e0e40ad4c7db>\",\"Content-Length\":\"29341\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:c1838810-30d1-4765-936f-5b08760cf1cb>\",\"WARC-Concurrent-To\":\"<urn:uuid:992d8e8f-e416-455b-8345-00a135b92131>\",\"WARC-IP-Address\":\"151.101.66.217\",\"WARC-Target-URI\":\"https://metacpan.org/pod/release/PRBRENAN/Math-Zap-1.07/pod/README.pod\",\"WARC-Payload-Digest\":\"sha1:ZSWVXGIQJPJYEUYMGAODL46VVCE34T3U\",\"WARC-Block-Digest\":\"sha1:B7Y7X7RPJOGB35ZPCCKENQ74VLNHE4S5\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540533401.22_warc_CC-MAIN-20191211212657-20191212000657-00508.warc.gz\"}"}