Results 1 to 3 of 3

Thread: <instance> element order

  1. #1

    <instance> element order

    Is the position of the <instance> element under a <node> element important in relation to <translate>/<rotate>/<scale> elements?

    For example:
    A piece of a Collada file reads (attributes removed):

    Code :
    <node>
      <instance>
      <translate>
      <scale>

    In this example instance comes before <translate> and <scale> so the matrix which defines the position, rotation and scale of <instance> doesn't include the <translate> and <scale> which follow it.

    To include the <translate> and <scale> it should be:

    Code :
    <node>
      <translate>
      <scale>
      <instance>

    Is this correct or is the position of the <instance> element unimportant?

    The specification isn't clear about this, and the max and maya plugins differ in the position in which they put the <instance> element.

    If the position of the <instance> element is important, it looks like the Max Collada script needs another fix.

  2. #2
    Senior Member
    Join Date
    Apr 2005
    Location
    Feeling Software, Montreal, Quebec
    Posts
    111
    Hi,

    I believe if I interpret the specifications correctly, the order of the transforms matters, but the order of everything else under the <node> is irrelevant. That's from page 3-9 of the 1.3 specification:

    "The <node> element represents a context in which the child transform elements are composed in the order that they occur. All other child elements are affected equally by the accumulated transform in the scope of the <node> element".

    So, the <instance> may be at the beginning or at the end. In both cases, it will be affected fully by the transformation.

    Sincerely,
    Guillaume Laforte
    Feeling Software Inc
    http://www.feelingsoftware.com
    Guillaume Laforte
    Feeling Software Inc
    http://www.feelingsoftware.com

  3. #3
    Thanks. I agree with your interpretation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •