Well, I still get the following set of warnings (maybe not the same ones, but at least fewer of them) -- and two of the lines you just quoted are among them:
Using an array as a reference is deprecated at /tmp/3dgraphics2.perl l +ine 989. Using an array as a reference is deprecated at /tmp/3dgraphics2.perl l +ine 990. Using an array as a reference is deprecated at /tmp/3dgraphics2.perl l +ine 1094. Using an array as a reference is deprecated at /tmp/3dgraphics2.perl l +ine 1096. Using an array as a reference is deprecated at /tmp/3dgraphics2.perl l +ine 1129.
where this is offending expression at lines 1094 and 1096:
@{$zbuffer}->[$x]->[$y]
I tried changing these two to be:
$$zbuffer[$x][$y]
the code still ran and still did the wrong things, same as before. As for what you may be doing wrong in one or the other spot of code, I couldn't guess, but consider doing "perl -d yourscript" to run it with the debugger.

When you see the "DB<1>" prompt, type "b 251" -- that sets a breakpoint at the start of this expression:

my $rec = { edge => [$A, $B], dx => abs($X1 - $X2), dz => $Z1 - $Z2, z => ( $X1 < $X2 ) ? ($Z1) : ($Z2) };
then type "c" to run the script till it reaches that break point. The GUI comes up, you can set parameters (I chose to set "rotX" of "40" instead of "0"), and hit the "Draw" button. Eventually the program will stop when it hits the chosen line, and you get the "DB" prompt back; see "perldebug" and "perldebtut" for fun things to try.

In reply to Re: Re: Re: help with Z-buffer algorithm by graff
in thread help with Z-buffer algorithm by rbc

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.