Results 1 to 8 of 8

Thread: Implementing a collada reader for my game.

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    4

    Implementing a collada reader for my game.

    Hello.

    I'm trying to implement a collada reader for my game, with the aim to :
    - edit mesh from 3ds max
    - export the mesh in a .dae
    - read the .dae by my game engine
    - create the mesh in the game engine by translation of the file to one or more vertex array
    - export the mesh in optimized binary file.

    I'm having issue to understand how to read the collada file for mesh. I'm trying to export a random mesh from 3ds max wich have 3 materials assigned to it.

    BUT, in the .dae, I have 3 <triangles>, one per material, with the exact number of indices! Also, the indices of the triangles are all the sames for each 3 <triangles>. If I understand right, each <triangles> should have the indices of the triangles using the corresponding material. Do I understand it right? Should I use a particular option in 3DS max to have my <triangles> correctly composed?

    Code :
    <triangles count="388" material="Concrete">
    <input semantic="VERTEX" offset="0" source="#Terrain-VERTEX"/>
    <input semantic="NORMAL" offset="1" source="#Terrain-Normal0"/>
    <input semantic="TEXCOORD" offset="2" set="0" source="#Terrain-UV0"/>
    <p>...</p>
    </triangles>
    <triangles count="388" material="Road">
    <input semantic="VERTEX" offset="0" source="#Terrain-VERTEX"/>
    <input semantic="NORMAL" offset="1" source="#Terrain-Normal0"/>
    <input semantic="TEXCOORD" offset="2" set="0" source="#Terrain-UV0"/>
    <p>... </p>
    </triangles>
    <triangles count="388" material="Grass">
    <input semantic="VERTEX" offset="0" source="#Terrain-VERTEX"/>
    <input semantic="NORMAL" offset="1" source="#Terrain-Normal0"/>
    <input semantic="TEXCOORD" offset="2" set="0" source="#Terrain-UV0"/>
    <p>...</p>
    <triangles>

    With regards, Spidyy

  2. #2
    Junior Member
    Join Date
    Jan 2013
    Posts
    14
    Friend , I can't understood you ,what is the point ?

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    4
    The point is : why do I have the same triangles for each materials, when the materials are applied on different triangles under 3ds max?

  4. #4
    Junior Member
    Join Date
    Jan 2013
    Posts
    14
    Maybe it has the same triangles indeed,change other models and try

  5. #5
    Junior Member
    Join Date
    Jan 2013
    Posts
    4
    I checked my 3ds model multiple time, asked a 3D artist friend to check it too, nothing's wrong. I read the default COLLADA exporter of 3ds max is somewhat buggy, so it might come from this. I'm looking for a 3ds max DAE exporter compatible with 3ds max 2013, as OpenCOLLADA is only compatible up to 2011.

  6. #6
    Junior Member
    Join Date
    Jan 2013
    Posts
    14
    Oh,the version problem.
    By the way do you know how to Reference one daeElement (e.g.<node>) from other .dae document ?

  7. #7
    Junior Member
    Join Date
    Jan 2013
    Posts
    4
    Huh... Just keep the element's id/name, then open your other .dae document and find it? .dae are plain xml with specific node names. If you know how to manipulate xml, you should easily find what you are looking for.

  8. #8
    Junior Member
    Join Date
    Mar 2012
    Posts
    3
    We had the same problem here (all polygons of the model were included in all material subsets).
    Turned out that this was a bug in the Autodesk FBX Collada Exporter.
    It has been fixed with the version 2013.2 (see the release notes http://area.autodesk.com/forum/autod...-now-available).

Posting Permissions

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