COLLADA loading problem

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
alelink
Posts: 52
Joined: Tue Jan 20, 2004 8:32 pm
Location: Italy
Contact:

COLLADA loading problem

Post by alelink »

Hello to all,
how use a collada's dae mesh?

my program call simply "smgr->addAnimatedMeshSceneNode(smgr->getMesh("cube.dae"));" and in execution it crashes!


how I do?


thank
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

The collada loader works differently. Just do a smgr->getMesh("cube.dae"); That's all. It should create instances of the meshes automaticly. I've written a short explanation here: http://irrlicht.sourceforge.net/docu/cl ... r.html#a38
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

I'm having problems too. The app compiles ok but I get memory problems when console starts loading things.

Or perhaps I'm not using the script for max properly.

edited: this is my code; do we need to add a node to the mesh to manipulate it?

Code: Select all

//load the map
	IAnimatedMesh* mesh = 0;
	mesh = smgr->getMesh("./data/level.dae"); 
//-----------------------------------------------------------------------------------------------//
	//add map to the scene
	ISceneNode* node = smgr->addOctTreeSceneNode(mesh->getMesh(0));	
alelink
Posts: 52
Joined: Tue Jan 20, 2004 8:32 pm
Location: Italy
Contact:

Post by alelink »

my apps crash again,

I have a simple dae file with a cube and non more.


it's strange
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

yup, mine too.

here's the screenie of the error:
Image
zardoz
Posts: 11
Joined: Sat Dec 18, 2004 5:18 pm

Post by zardoz »

any luck with collada?

it loads this file without crash... but mesh is not displayed
is it too small?

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<COLLADA xmlns="http://www.collada.org/2004/COLLADASchema" version="1.0.0">
	<asset>
		<revision>1.0</revision>
		<authoring_tool>3DSMAX6 Collada exporter v1.0</authoring_tool>
		<modified>2004-08-10T23:06:46Z</modified>
	</asset>
	<library type="LIGHT">
		<light name="Fspot01" type="SPOT">
						<param name="DIFFUSE" type="ColorRGBA" flow="IN">0 1 0 1</param>
						<param name="SPECULAR" type="ColorRGBA" flow="IN">0 1 0 1</param>
						<param name="INTENSITY" type="float" flow="IN">1</param>
						<param name="ASPECT" type="float" flow="IN">1</param>
						<param name="HOTSPOTSIZE" type="float" flow="IN">43</param>
						<param name="FALLOFFSIZE" type="float" flow="IN">45</param></light>
		<light name="Omni01" type="POINT">
						<param name="DIFFUSE" type="ColorRGBA" flow="IN">0 0 1 1</param>
						<param name="SPECULAR" type="ColorRGBA" flow="IN">0 0 1 1</param>
						<param name="INTENSITY" type="float" flow="IN">1</param>
						<param name="ASPECT" type="float" flow="IN">-1</param></light>
		<light name="FDirect01" type="DIRECTIONAL">
						<param name="DIFFUSE" type="ColorRGBA" flow="IN">0.980392 0 0.968628 1</param>
						<param name="SPECULAR" type="ColorRGBA" flow="IN">0.980392 0 0.968628 1</param>
						<param name="INTENSITY" type="float" flow="IN">1</param>
						<param name="ASPECT" type="float" flow="IN">1</param>
						<param name="HOTSPOTSIZE" type="float" flow="IN">43</param>
						<param name="FALLOFFSIZE" type="float" flow="IN">45</param></light>
		<light name="Omni02" type="AMBIENT">
						<param name="AMBIENT" type="ColorRGBA" flow="IN">0.521569 0.521569 0.521569 1</param>
						<param name="INTENSITY" type="float" flow="IN">1</param>
						<param name="ASPECT" type="float" flow="IN">-1</param></light></library>
	<library type="CAMERA">
		<camera name="Camera01">
			<technique profile="COMMON1.0">
				<optics>
					<program name="PERSPECTIVE">
						<param name="YFOV" type="float" flow="OUT">0.334182</param>
						<param name="ZNEAR" type="float" flow="OUT">0</param>
						<param name="ZFAR" type="float" flow="OUT">1000</param></program></optics></technique></camera></library>
	<library type="TEXTURE"/>
	<library type="MATERIAL"/>
	<library type="GEOMETRY">
		<geometry name="Box01">
			<mesh>
				<source name="Box01-position">
					<array name="Box01-position-array" type="float" count="24">
-0.5 -0.5 0
0.5 -0.5 0
-0.5 0.5 0
0.5 0.5 0
-0.5 -0.5 1
0.5 -0.5 1
-0.5 0.5 1
0.5 0.5 1
</array>
					<technique profile="COMMON1.0">
						<accessor source="#Box01-position-array" count="8" stride="3">
							<param name="X" type="float" flow="OUT"/>
							<param name="Y" type="float" flow="OUT"/>
							<param name="Z" type="float" flow="OUT"/></accessor></technique></source>
				<source name="Box01-normal">
					<array name="Box01-normal-array" type="float" count="108">
0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 -1 0 0 </array>
					<technique profile="COMMON1.0">
						<accessor source="#Box01-normal-array" count="36" stride="3">
							<param name="X" type="float" flow="OUT"/>
							<param name="Y" type="float" flow="OUT"/>
							<param name="Z" type="float" flow="OUT"/></accessor></technique></source>
				<polygons count="12">
				<input semantic="POSITION" source="#Box01-position"/>
				<input semantic="NORMAL" source="#Box01-normal"/>
					<p>0 0 2 1 3 2</p>
					<p>3 3 1 4 0 5</p>
					<p>4 6 5 7 7 8</p>
					<p>7 9 6 10 4 11</p>
					<p>0 12 1 13 5 14</p>
					<p>5 15 4 16 0 17</p>
					<p>1 18 3 19 7 20</p>
					<p>7 21 5 22 1 23</p>
					<p>3 24 2 25 6 26</p>
					<p>6 27 7 28 3 29</p>
					<p>2 30 0 31 4 32</p>
					<p>4 33 6 34 2 35</p></polygons></mesh></geometry></library>
	<scene name="Default Scene">
		<node name="Box01">
			<instance url="#Box01"/>
			<matrix>1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 8.40779e-045
</matrix></node>
		<node name="Fspot01">
			<instance url="#Fspot01"/>
			<matrix>0.572039 0 0 1.02386
0 0.572039 0 5.46657
0 0 0.572039 52.9869
0 0 1.02386 2.8026e-045
</matrix></node>
		<node name="Omni01">
			<instance url="#Omni01"/>
			<matrix>1 0 0 -0.728051
0 1 0 -1.8137
0 0 1 0.319267
0 0 -0.728051 8.40779e-045
</matrix></node>
		<node name="FDirect01">
			<instance url="#FDirect01"/>
			<matrix>0.531881 0 0.284464 50.4078
0 0.603173 0 0.879061
-0.284464 0 0.531881 115.376
0 0.284464 50.4078 0
</matrix></node>
		<node name="Omni02">
			<instance url="#Omni02"/>
			<matrix>1 0 0 2.57005
0 1 0 -1.93855
0 0 1 0
0 0 2.57005 8.40779e-045
</matrix></node>
		<node name="Camera01">
			<instance url="#Camera01"/>
			<matrix>0.851748 -0.293737 0.433871 13.5973
0.523942 0.482443 -0.701949 -21.9551
-0.00312995 0.825207 0.564821 17.5381
-0.293737 0.433871 13.5973 5.60519e-045
</matrix></node></scene>
</COLLADA>

katoun
Posts: 239
Joined: Mon Nov 15, 2004 9:39 am
Location: Romania
Contact:

Post by katoun »

This is for the Irrlicht documentation:

Code: Select all

However, if the COLLADA file does not include any <instance> tags, only meshes will be loaded by the engine and no scene nodes should be created. Meshes included in the scene will be added into the scene manager with the following naming scheme: path/to/file/file.dea#meshname
What does Niko mean by

Code: Select all

<instance> tags
?
Kat'Oun
katoun
Posts: 239
Joined: Mon Nov 15, 2004 9:39 am
Location: Romania
Contact:

Post by katoun »

Anyway I need some help:
I have 3dMax5 and I found on the collada web page the script file for the exporter but when I run them they give me an error.
So dose anyone found some working Collada exporters for max(even for 6 would be good, but to work).
Thank you.
Kat'Oun
zardoz
Posts: 11
Joined: Sat Dec 18, 2004 5:18 pm

Post by zardoz »

katoun wrote:Anyway I need some help:
I have 3dMax5 and I found on the collada web page the script file for the exporter but when I run them they give me an error.
So dose anyone found some working Collada exporters for max(even for 6 would be good, but to work).
Thank you.
if it (export script) gives you error with time array (modification time) then just comment the line with error (it will not break any of essential output).

but in any case I am stuck with the COLLADA format... nothing I tried worked... can anyone cofirm if it is possible to load COLLADA? or drop a working sample here....
alelink
Posts: 52
Joined: Tue Jan 20, 2004 8:32 pm
Location: Italy
Contact:

Post by alelink »

hello,
I've exported several meshes from Maya and irrlicht crashes when it loads them, but maya can import those meshes!

dont' know....

maybe dae files are binaries?
zardoz
Posts: 11
Joined: Sat Dec 18, 2004 5:18 pm

Post by zardoz »

alelink wrote:maybe dae files are binaries?
no
T34

Post by T34 »

I have version 1.2.3 of COLLADA and an exporter for 3dmax 7 from collada's site. And it crashes with tutorial for loading meshes.

Is this problem solved?
scotte
Posts: 3
Joined: Thu Oct 26, 2006 5:56 pm

Post by scotte »

when loading a collada mesh the getMesh function will return a "dummy object"... what is the real value of the dummy object? I don't know... But if it's supposed to be a "dummy object", I doubt your supposed to use it when attempting to create a scene node.

So if your code is failing... as coded below... it's probably because your using a non-valid Mesh object when attempting to create your scene node.

Now how do we properly load a Collada Mesh and create a scene node? Beats me... If anyone know how...

//load the map
IAnimatedMesh* mesh = 0;
mesh = smgr->getMesh("./data/level.dae");
//-----------------------------------------------------------------------------------------------//
//add map to the scene
ISceneNode* node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
Post Reply