Results 1 to 2 of 2

Thread: accessor/param syntax question

  1. #1
    mmikkelsen
    Guest

    accessor/param syntax question

    I've noticed that in all collada files (which I have seen up until now)
    the accessor, when using float_array, is declared using param of type float
    for every single float value read. Whether it's a vertex or a vertex attribute each float is fetched this way one at a time.

    So far it appears to be doing it like this everywhere except for one section in the file and that is library_controllers. In this section all of a sudden I am seeing accessors declared with param of type float4x4. This seems truly odd. If float4x4 is supported then I assume float2 and float3 are supported as well? And if so then why not use them for vertices+attributes?
    Is it considered valid syntax or not to use the following:

    <param name="vert" type="float3"/>

    In which case I'm wondering what's the limit. Can I use float7x11 ? or only those which
    exist in shader syntax? Either way I'm wondering why every case except the float4x4 in the collada file is defined one float at a time. One param per float. ie. .xyz becomes 3 params within the accessor.

    Hope someone can clear up this mystery. Thanks.

  2. #2
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: accessor/param syntax question

    On page 5-5 of the COLLADA 1.5 specification (pdf page 45) it says:

    <param> (data flow)
    The type attribute of the <param> element, when it is a child of the <accessor> element, is restricted to the set of array types: int, float, Name, bool, IDREF, and SIDREF. See main entry.
    .. therefore conformant documents must not contain other application types like float2 or float3 in this context. The <param> element is used in other places, outside of accessor, where this constraint does not apply. For the things you are testing though, it does.

    From what the spec says about the <accessor> element (pages 45-50), it should follow that it extracts count and stride values from the associated array and binds them to named parameters. The stride value must be equal or greater than the number of parameters. Therefore the unit of extraction is an array element and the type of the extracted value is determined by the array, e.g. an int_array extracts an int, a float_array extracts a float, etc..

Posting Permissions

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