Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
When I ran your code with perl 5.8, I got these warnings:
Using an array as a reference is deprecated at /tmp/3dgraphics.perl li +ne 989. Using an array as a reference is deprecated at /tmp/3dgraphics.perl li +ne 990. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1004. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1004. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1004. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1064. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1064. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1076. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1077. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1081. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1082. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1087. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1091. Using an array as a reference is deprecated at /tmp/3dgraphics.perl li +ne 1092. Using an array as a reference is deprecated at /tmp/3dgraphics.perl li +ne 1094. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1101. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1107. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1108. Using a hash as a reference is deprecated at /tmp/3dgraphics.perl line + 1108. Using an array as a reference is deprecated at /tmp/3dgraphics.perl li +ne 1127.
This stuff arises from lines like this (this is the code at line 1064):
@AET = sort{ %{$a}->{Xbot} <=> %{$b}->{Xbot} } @AET;
Sure enough, you're using the "%" sigil on a value that is supposed to be treated as a scalar.

You should try to adjust the lines involved to see if you can avoid those warnings -- then see if the code behaves the same way. (There's a chance that the values you are manipulating are not what you're expecting them to be.)

update: forgot to mention: just because you're using Tk doesn't mean you can't use the perl debugger. Run the script with "perl -d" and put breakpoints at some of those lines that are setting and testing Z-buffer values; when the code gets to one of those lines, look at the values being tested or assigned. (And figure out if it's just something simple, like adding when you should be subtracting, or whatever.)


In reply to 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2024-04-24 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found