Problem loading collada files

Physics APIs, Physics file formats, Maya, Max, XSI, Cinema 4D, Lightwave, Blender, thinkingParticles™ and other simulation tools, exporters and importers
Y0z2
Posts: 1
Joined: Wed Jul 09, 2008 3:27 pm

Problem loading collada files

Post by Y0z2 »

I got 2 question about the colladaconverter

Its my first time using bullet
As my project want to use bullet as physic engine, loading collada files, so my task is to test the capability of collada with bullet.
I went through the source code and compile the colladaconverter demo from the bullet, and everything was fine

then I go on and test if the converter work with other collada files
so I went to google 3D warehouse and pick a nice Fragmentation -Frag- Anti-Personell Grenade
first I copy and paste the green-aid.dae file from the zip to the bullet dir (where the jenga.dae is)
then create a bat file with DebugColladaDemo.exe green-aid.dae ( run the demo with argument of the file name)
and I end up with some errors like "No Triangles or Polygons found int Geometry"?

What I interpreted is
the file does load into the convertor, and the function convert ran
the problem comes in when it load the meshs
so I picked some problem mesh and went into the dae
and compare the problem mesh with the normal mesh ( I found the mesh1-geometry is ok and mesh2-geometry have error)
and found that the mesh1-geometry under geometry>mesh there are
<source id="mesh1-geometry-position">
<source id="mesh1-geometry-normal">
<source id="mesh1-geometry-uv">
<vertices id="mesh1-geometry-vertex">
<triangles material="material0" count="752">
and for the mesh2-geometry under geometry> mesh there are
<source id="mesh2-geometry-position">
<vertices id="mesh2-geometry-vertex">
<lines material="ForegroundColor" count="27">
Q1
is the problem come from the collada file I downloaded (not a standard one)?
or the convertor lacks some function to cope with all collada files?
Q2
my another question: the demo shows us how the colladaconverter load the jenga.dae
which include the model, camera, gravity etc, almost everything are defined from the collada file
so its like a save file of a scen how about I want to load eg the track from 1 collada file and cars from other collada files? will I be able to do that with the converter? or I have to modifly the converter for this task?

please kindly help
Y0z2
stenyak
Posts: 29
Joined: Fri Aug 12, 2005 4:59 pm

Re: Problem loading collada files

Post by stenyak »

Y0z2 wrote:Q2
my another question: the demo shows us how the colladaconverter load the jenga.dae
which include the model, camera, gravity etc, almost everything are defined from the collada file
so its like a save file of a scen how about I want to load eg the track from 1 collada file and cars from other collada files? will I be able to do that with the converter? or I have to modifly the converter for this task?
This should be doable using external references ("xrefs" iirc), which is a standard feature of the collada format. It supports local filesystem, as well as ftp, http, and even custom protocols (ed2k, or whatever we may invent), which is a nice thing.

Does anyone know if the bullet collada layer supports this already?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Problem loading collada files

Post by Erwin Coumans »

Make sure that the meshes are triangulated, BulletColladaConverter doesn't deal with quads or other non-triangle meshes.
Q2
my another question: the demo shows us how the colladaconverter load the jenga.dae
which include the model, camera, gravity etc, almost everything are defined from the collada file
so its like a save file of a scen how about I want to load eg the track from 1 collada file and cars from other collada files? will I be able to do that with the converter? or I have to modifly the converter for this task?
Bullet uses COLLADA DOM, which usually supports external references. However, the COLLADA DOM version included in Bullet has this feature disabled, to avoid licensing issues and code bloat. Just use the regular version of COLLADA DOM if you really need external references.

Hope this helps,
Erwin