G'day Fair Strides,

Some sample input data, actual results and expected results would have helped. A short script that reproduced your problem would have helped even more: we could have run it, tweaked it and suggested modifications. The guidelines in "How do I post a question effectively?" explain how to do this.

"Here's the code I have for reading the info from a hash-of-hashes ..."

As I already alluded to, you provide no indication of the structure of this "hash-of-hashes" nor what data populates it. In the code, you have variables with no indication of how they were declared or what values they might hold. In order to troubleshoot this, we'd need to make many guesses regarding data, context and the value of variables: guessing is not a good way to proceed.

"and the code that takes the measure of degrees ..."

Much the same comments apply here also. It looks like Tk code but you don't specify this. It contains non-essential, distracting clutter like font families and sizes; but important information, such as variable declarations, is missing.

Here's a few comments on what you have provided:

See also: Math::Trig (for pi constants and functions such as deg2rad); Math::Quaternion (for the creation and manipulation of quaternions); SecondLife::Rotation (for an example of how to subclass Math::Quaternion, should you need that).

"The game has a built-in scripting language, ..."

[The following (in the spoiler) has nothing at all to do with Perl; it's about NWScript. Of interest to the OP, but of little or no interest to others.]

-- Ken


In reply to Re: Perl and Quaternions by kcott
in thread Perl and Quaternions by Fair Strides

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.