I'm currently working on a top down space shooter engine and was trying to compress my plane animation script At the moment I have:

glBegin(GL_POLYGON); @pos=($_[0],$_[1]); my $rot = $_[2]*0.0174; my @point1=($pos[0],$pos[1]); my @point2=($point1[0]+(cos($rot+90)*10),$point1[1]+(sin($rot+90)*10)) +; my @point3=($point2[0]+(cos($rot+45)*6),$point2[1]+(sin($rot+45)*6)); my @point4=($point3[0]+(cos($rot)*4),$point3[1]+(sin($rot)*4)); my @point5=($point4[0]-(cos($rot+225)*8),$point4[1]-(sin($rot+225)*8)) +; glVertex2f($point1[0],$point1[1]); glVertex2f($point2[0],$point2[1]); glVertex2f($point3[0],$point3[1]); glVertex2f($point4[0],$point4[1]); glVertex2f($point5[0],$point5[1]);

Which I replaced with :

my @ang=(0,90,45,0,225); my @dist=(0,10,6,4,8); my $rot = $_[2]*0.0174; my $points=[]; my @prev=($_[0],$_[1]); glBegin(GL_POLYGON); for ($posi =1,$posi<5,$posi++){ @prev=($prev[0]+(cos($rot+$ang[$posi])*$dist[$posi]),$prev[1]+(sin($ +rot+$ang[$posi])*$dist[$posi])); $points[$posi]=($prev[0],$prev[1]); glVertex2f($prev[0],$prev[1]); }
However I'm getting no display at all yet no errors. Could someone give me a bump in the right direction?

In reply to Data not acting as expected. by Pseudomander

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.