Collada Full Scene

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
NemoStein
Posts: 17
Joined: Mon Aug 11, 2008 12:04 am

Collada Full Scene

Post by NemoStein »

Hello everyone!

I'm having some trouble setting up a scene with the collada loader.
I don't know if it's working properly and this is the correct behavior or something is wrong.
I'll describe my setup...

My .dae file was exported from 3d Max 2012 using the default FBX Exporter.
The whole scene is composed from one box without 3 sides called "walls", a sphere called "sphere", a omni light called "light" and a camera called (guess) "camera".
The "walls" and "sphere" were converted to an editable mesh and have an UVW map.

Now, my code is the following (I'm using the IrrLicht Lime .NET Wrapper by greenya, but the snippet is simple enough to follow):

Code: Select all

// create device ...
 
smgr.Attributes.SetValue(SceneParameters.COLLADA_CreateSceneInstances, true);
smgr.GetMesh("assets/scene.dae");
 
smgr.AddLightSceneNode(null, new Vector3Df(0, 15, -20));
smgr.AddCameraSceneNode(null, new Vector3Df(0, 30, -40));
 
// device.Run() loop ...
Can't be simpler, right?

The "smgr.GetMesh()" returns a dummy mesh, and that's what I expect.
What I don't get is that it automagically puts the first (and only the first) mesh into the scene.
Adding nothing is something that I can expect and understand but adding everything is what I want.

To further complicate things the docs says that:
Created scene nodes will be named as the names of the nodes in the COLLADA file.
Meshes included in the scene will be added into the scene manager with the following naming scheme: "path/to/file/file.dea#meshname".
The "will be added into the scene manager" doesn't seems to work except for the first mesh in the .dae, and the "path/to/file/file.dea#meshname" is really, REALY unpredictable.
After fiddling a lot with the scene I was able to retrieve the following name pattern:
"C:/.../assets/scene.dae35walls-lib" (where "C:/..." is a lot of nested folders that leads to my project)
The docs says that the pattern should have a # (sharp) after the extension, but in my case is a number, and I don't know if this number will change from time to time.
The name of the mesh is different from my .max file, as it have this suffix "-lib"...
And using the absolute path to the file is something impossible to use in production, as the file path will change from machine to machine and I can't predict it...

Is this right, the expected behavior?
Why it's adding the only the first mesh into the scene, or worse, why it's adding something that I didn't asked for?
Is there any way to collect and use the elements in a reasonable manner?
Can I force it to add everything or nothing instead of one arbitrary element to the scene?

Sorry for the long post and (probably) bad english...
Thank you all in advance.

ps: Thank you greenya for your wrapper... ;D

[EDIT]
No matter what, I can't find a way to get the camera and light. The meshes I can retrieve through the "smgr.MeshCache", but lights and cameras aren't meshes, so they don't get listed here...
Last edited by NemoStein on Fri Nov 08, 2013 1:16 pm, edited 1 time in total.
NemoStein
Posts: 17
Joined: Mon Aug 11, 2008 12:04 am

Re: Collada Full Scene

Post by NemoStein »

Ok, so after some hours smashing my forehead against the keyboard I tried a different approach...
Instead of using the 3ds Max default FBX Exporter I googled a bit and found the OpenCOLLADA exporter plugin.
After installing it and exporting my scene with it most things just worked! =D

The only thing that I still miss is the camera that simply doesn't want to load...
Better than before, at least.

Now, except for the camera, the whole scene is loaded and added, and the lights are added correctly (I must check the color and intensity yet).

Does anyone knows what can be?
By the way, is there any other attribute that I can set on my .dae that is loaded in IrrLicht?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Collada Full Scene

Post by CuteAlien »

There are no other attributes to my knowledge. Cameras should load - if you send me the file I can do a quick check if it loads here (it shows the information on console when Irrlicht is compiled in debug).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
NemoStein
Posts: 17
Joined: Mon Aug 11, 2008 12:04 am

Re: Collada Full Scene

Post by NemoStein »

CuteAlien, thanks for your attention... =]

I'll paste here my code and .dae file, so you can check it out.

As I said, I'm using the IrrLicht Lime .NET Wrapper, so my code is C#, but it's fairly simple.

Code: Select all

using System;
using System.Collections.Generic;
 
using IrrlichtLime;
using IrrlichtLime.Video;
using IrrlichtLime.Core;
using IrrlichtLime.Scene;
 
namespace IrrlichtTest
{
    class Example
    {
        static void Main(string[] args)
        {
            IrrlichtDevice device = IrrlichtDevice.CreateDevice(DriverType.OpenGL, new Dimension2Di(800, 600));
 
            VideoDriver video = device.VideoDriver;
            SceneManager scene = device.SceneManager;
 
            scene.Attributes.SetValue(SceneParameters.COLLADA_CreateSceneInstances, true);
            scene.GetMesh("assets/scene.dae");
 
            List<SceneNode> nodes = scene.GetSceneNodesFromType(SceneNodeType.Any);
 
            // Printing scene nodes
            for (int i = 0; i < nodes.Count; i++)
            {
                Console.WriteLine(nodes[i].Type + " :: " + nodes[i].Name);
            }
 
            while (device.Run())
            {
                video.BeginScene(true, true, new Color(100, 101, 140));
                scene.DrawAll();
                video.EndScene();
            }
 
            device.Drop();
        }
    }
}
As you can see I'm printing the type and name of the scene nodes and this is the console output:

Code: Select all

SceneManager ::
DummyTransformation ::
DummyTransformation :: MaxScene
DummyTransformation :: EnvironmentAmbientLight
DummyTransformation :: node-Walls
DummyTransformation ::
Mesh :: geom-Walls
DummyTransformation :: node-Omni
Light :: Omni-light
DummyTransformation :: node-Sphere
Mesh :: geom-Sphere
And here is my scene.dae

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
  <asset>
    <contributor>
      <author>NemoStein</author>
      <authoring_tool>OpenCOLLADA for 3ds Max;  Version: 1.3.1;  Revision: 847M;  Platform: x64;  Configuration: Release_Max2012_static</authoring_tool>
      <source_data>file:///D:/Workspaces/C#/Test/IrrLichtTest/Resources/scene.max</source_data>
    </contributor>
    <created>2013-11-04T14:13:18</created>
    <modified>2013-11-04T14:13:18</modified>
    <unit name="inch" meter="0.0254"/>
    <up_axis>Z_UP</up_axis>
  </asset>
  <library_effects>
    <effect id="ColorEffectR85G28B177">
      <profile_COMMON>
        <technique sid="common">
          <phong>
            <ambient>
              <color>0.3333333 0.1098039 0.6941177 1</color>
            </ambient>
            <diffuse>
              <color>0.3333333 0.1098039 0.6941177 1</color>
            </diffuse>
            <specular>
              <color>1 1 1 1</color>
            </specular>
            <shininess>
              <float>10</float>
            </shininess>
            <reflective>
              <color>0 0 0 1</color>
            </reflective>
            <transparent>
              <color>1 1 1 1</color>
            </transparent>
            <transparency>
              <float>1</float>
            </transparency>
          </phong>
        </technique>
      </profile_COMMON>
    </effect>
    <effect id="ColorEffectR87G120B204">
      <profile_COMMON>
        <technique sid="common">
          <phong>
            <ambient>
              <color>0.3411765 0.4705882 0.8 1</color>
            </ambient>
            <diffuse>
              <color>0.3411765 0.4705882 0.8 1</color>
            </diffuse>
            <specular>
              <color>1 1 1 1</color>
            </specular>
            <shininess>
              <float>10</float>
            </shininess>
            <reflective>
              <color>0 0 0 1</color>
            </reflective>
            <transparent>
              <color>1 1 1 1</color>
            </transparent>
            <transparency>
              <float>1</float>
            </transparency>
          </phong>
        </technique>
      </profile_COMMON>
    </effect>
    <effect id="ColorEffectR138G8B110">
      <profile_COMMON>
        <technique sid="common">
          <phong>
            <ambient>
              <color>0.5411765 0.03137255 0.4313726 1</color>
            </ambient>
            <diffuse>
              <color>0.5411765 0.03137255 0.4313726 1</color>
            </diffuse>
            <specular>
              <color>1 1 1 1</color>
            </specular>
            <shininess>
              <float>10</float>
            </shininess>
            <reflective>
              <color>0 0 0 1</color>
            </reflective>
            <transparent>
              <color>1 1 1 1</color>
            </transparent>
            <transparency>
              <float>1</float>
            </transparency>
          </phong>
        </technique>
      </profile_COMMON>
    </effect>
  </library_effects>
  <library_materials>
    <material id="ColorEffectR85G28B177-material" name="ColorEffectR85G28B177-material">
      <instance_effect url="#ColorEffectR85G28B177"/>
    </material>
    <material id="ColorEffectR87G120B204-material" name="ColorEffectR87G120B204-material">
      <instance_effect url="#ColorEffectR87G120B204"/>
    </material>
    <material id="ColorEffectR138G8B110-material" name="ColorEffectR138G8B110-material">
      <instance_effect url="#ColorEffectR138G8B110"/>
    </material>
  </library_materials>
  <library_geometries>
    <geometry id="geom-Walls" name="Walls">
      <mesh>
        <source id="geom-Walls-positions">
          <float_array id="geom-Walls-positions-array" count="21">-50 -50 0 50 -50 0 -50 50 0 50 50 0 -50 -50 50 -50 50 50 50 50 50</float_array>
          <technique_common>
            <accessor source="#geom-Walls-positions-array" count="7" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="geom-Walls-normals">
          <float_array id="geom-Walls-normals-array" count="36">0 0 1 0 0 1 0 0 1 0 0 1 0 -1 0 0 -1 0 0 -1 0 0 -1 0 1 0 0 1 0 0 1 0 0 1 0 0</float_array>
          <technique_common>
            <accessor source="#geom-Walls-normals-array" count="12" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="geom-Walls-map1">
          <float_array id="geom-Walls-map1-array" count="36">4.99547e-4 4.99785e-4 4.99576e-4 0.9995002 4.99547e-4 4.99576e-4 4.99785e-4 0.9995005 4.99576e-4 0.9995005 0.9995002 4.99576e-4 4.99785e-4 0.9995004 4.99547e-4 4.99785e-4 0.9995004 0.9995005 0.9995005 0.9995004 0.9995002 0.9995005 4.99576e-4 0.9995002 4.99785e-4 4.99576e-4 0.9995005 0.9995005 4.99576e-4 4.99785e-4 0.9995005 0.9995004 4.99785e-4 4.99785e-4 4.99576e-4 4.99547e-4</float_array>
          <technique_common>
            <accessor source="#geom-Walls-map1-array" count="12" stride="3">
              <param name="S" type="float"/>
              <param name="T" type="float"/>
              <param name="P" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <vertices id="geom-Walls-vertices">
          <input semantic="POSITION" source="#geom-Walls-positions"/>
        </vertices>
        <triangles material="ColorMaterial" count="6">
          <input semantic="VERTEX" source="#geom-Walls-vertices" offset="0"/>
          <input semantic="NORMAL" source="#geom-Walls-normals" offset="1"/>
          <input semantic="TEXCOORD" source="#geom-Walls-map1" offset="2" set="0"/>
          <p>0 0 0 1 1 1 3 2 3 3 2 3 2 3 2 0 0 0 3 4 7 6 5 6 5 6 5 5 6 5 2 7 8 3 4 7 2 8 9 5 9 10 4 10 4 4 10 4 0 11 11 2 8 9</p>
        </triangles>
      </mesh>
    </geometry>
    <geometry id="geom-Sphere" name="Sphere">
      <mesh>
        <source id="geom-Sphere-positions">
          <float_array id="geom-Sphere-positions-array" count="342">0 0 5 -8.36381e-8 1.913417 4.619398 -0.7322333 1.767767 4.619398 -1.35299 1.35299 4.619398 -1.767767 0.7322332 4.619398 -1.913417 2.88918e-7 4.619398 -1.767767 -0.7322327 4.619398 -1.352991 -1.35299 4.619398 -0.7322334 -1.767767 4.619398 2.28173e-8 -1.913417 4.619398 0.7322335 -1.767767 4.619398 1.352991 -1.35299 4.619398 1.767768 -0.7322323 4.619398 1.913417 1.24694e-6 4.619398 1.767766 0.7322345 4.619398 1.352989 1.352992 4.619398 0.7322311 1.767768 4.619398 -1.54543e-7 3.535534 3.535534 -1.352991 3.266407 3.535534 -2.5 2.5 3.535534 -3.266407 1.35299 3.535534 -3.535534 5.33851e-7 3.535534 -3.266408 -1.352989 3.535534 -2.500001 -2.499999 3.535534 -1.352991 -3.266407 3.535534 4.21608e-8 -3.535534 3.535534 1.352991 -3.266407 3.535534 2.500001 -2.499999 3.535534 3.266408 -1.352989 3.535534 3.535534 2.30405e-6 3.535534 3.266406 1.352993 3.535534 2.499998 2.500002 3.535534 1.352987 3.266409 3.535534 -2.0192e-7 4.619398 1.913417 -1.767767 4.267767 1.913417 -3.266407 3.266407 1.913417 -4.267767 1.767767 1.913417 -4.619398 6.9751e-7 1.913417 -4.267767 -1.767766 1.913417 -3.266408 -3.266407 1.913417 -1.767768 -4.267767 1.913417 5.50858e-8 -4.619398 1.913417 1.767768 -4.267766 1.913417 3.266408 -3.266406 1.913417 4.267768 -1.767765 1.913417 4.619398 3.01038e-6 1.913417 4.267766 1.76777 1.913417 3.266404 3.266411 1.913417 1.767762 4.267769 1.913417 -2.18557e-7 5 -2.18557e-7 -1.913418 4.619398 -2.18557e-7 -3.535534 3.535534 -2.18557e-7 -4.619398 1.913417 -2.18557e-7 -5 7.54979e-7 -2.18557e-7 -4.619398 -1.913416 -2.18557e-7 -3.535535 -3.535533 -2.18557e-7 -1.913418 -4.619398 -2.18557e-7 5.96244e-8 -5 -2.18557e-7 1.913418 -4.619397 -2.18557e-7 3.535535 -3.535533 -2.18557e-7 4.619399 -1.913415 -2.18557e-7 5 3.25841e-6 -2.18557e-7 4.619396 1.913421 -2.18557e-7 3.535531 3.535537 -2.18557e-7 1.913412 4.6194 -2.18557e-7 -2.0192e-7 4.619398 -1.913418 -1.767767 4.267767 -1.913418 -3.266407 3.266407 -1.913418 -4.267767 1.767767 -1.913418 -4.619398 6.9751e-7 -1.913418 -4.267767 -1.767766 -1.913418 -3.266408 -3.266407 -1.913418 -1.767768 -4.267767 -1.913418 5.50858e-8 -4.619398 -1.913418 1.767768 -4.267766 -1.913418 3.266408 -3.266406 -1.913418 4.267768 -1.767765 -1.913418 4.619398 3.01038e-6 -1.913418 4.267766 1.76777 -1.913418 3.266404 3.266411 -1.913418 1.767762 4.267769 -1.913418 -1.54543e-7 3.535534 -3.535534 -1.352991 3.266407 -3.535534 -2.5 2.5 -3.535534 -3.266407 1.35299 -3.535534 -3.535534 5.33851e-7 -3.535534 -3.266408 -1.352989 -3.535534 -2.500001 -2.499999 -3.535534 -1.352991 -3.266407 -3.535534 4.21608e-8 -3.535534 -3.535534 1.352991 -3.266407 -3.535534 2.500001 -2.499999 -3.535534 3.266408 -1.352989 -3.535534 3.535534 2.30405e-6 -3.535534 3.266406 1.352993 -3.535534 2.499998 2.500002 -3.535534 1.352987 3.266409 -3.535534 -8.36381e-8 1.913417 -4.619398 -0.7322333 1.767767 -4.619398 -1.35299 1.35299 -4.619398 -1.767767 0.7322333 -4.619398 -1.913417 2.88918e-7 -4.619398 -1.767767 -0.7322327 -4.619398 -1.352991 -1.35299 -4.619398 -0.7322334 -1.767767 -4.619398 2.28173e-8 -1.913417 -4.619398 0.7322335 -1.767767 -4.619398 1.352991 -1.35299 -4.619398 1.767768 -0.7322323 -4.619398 1.913417 1.24694e-6 -4.619398 1.767767 0.7322346 -4.619398 1.352989 1.352992 -4.619398 0.7322311 1.767768 -4.619398 0 0 -5</float_array>
          <technique_common>
            <accessor source="#geom-Sphere-positions-array" count="114" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="geom-Sphere-normals">
          <float_array id="geom-Sphere-normals-array" count="342">-3.85609e-9 2.4679e-9 1 -1.59219e-7 0.4030927 0.9151592 -0.1542569 0.3724091 0.9151592 -0.2850296 0.2850295 0.9151592 -0.372409 0.1542569 0.9151592 -0.4030926 6.49124e-8 0.9151592 -0.3724091 -0.1542568 0.9151592 -0.2850296 -0.2850295 0.9151592 -0.1542569 -0.372409 0.9151592 3.55181e-8 -0.4030927 0.9151592 0.154257 -0.372409 0.9151592 0.2850296 -0.2850295 0.9151592 0.3724091 -0.1542567 0.9151592 0.4030927 2.91494e-7 0.9151592 0.372409 0.1542572 0.9151592 0.2850293 0.2850298 0.9151592 0.1542566 0.3724092 0.9151592 -0.2750952 0.6641384 0.6951566 -2.28642e-7 0.7188582 0.6951566 -0.5083096 0.5083096 0.6951566 -0.6641384 0.2750952 0.6951566 -0.7188582 1.46629e-7 0.6951566 -0.6641384 -0.275095 0.6951566 -0.5083096 -0.5083094 0.6951566 -0.2750952 -0.6641384 0.6951567 5.46753e-8 -0.7188583 0.6951566 0.2750953 -0.6641384 0.6951567 0.5083097 -0.5083095 0.6951567 0.6641386 -0.2750949 0.6951566 0.7188584 5.02019e-7 0.6951567 0.6641383 0.2750957 0.6951567 0.5083091 0.5083101 0.6951567 0.2750947 0.6641387 0.6951567 -0.354855 0.8566955 0.374367 -2.46362e-7 0.9272807 0.374367 -0.6556864 0.6556864 0.374367 -0.8566956 0.354855 0.374367 -0.9272807 1.38264e-7 0.374367 -0.8566957 -0.3548547 0.374367 -0.6556866 -0.6556862 0.374367 -0.354855 -0.8566957 0.374367 1.0307e-7 -0.9272807 0.374367 0.3548551 -0.8566955 0.374367 0.6556866 -0.6556862 0.374367 0.8566957 -0.3548546 0.374367 0.9272807 6.10878e-7 0.374367 0.8566952 0.3548556 0.374367 0.6556858 0.655687 0.374367 0.3548542 0.8566959 0.374367 -0.3826835 0.9238796 -1.00993e-8 -3.33278e-7 1 1.5149e-8 -0.7071068 0.7071068 -1.00993e-8 -0.9238796 0.3826835 7.5745e-9 -1 1.28766e-7 1.26242e-8 -0.9238796 -0.3826832 -5.04967e-9 -0.707107 -0.7071066 0 -0.3826836 -0.9238796 -2.52483e-9 1.26242e-7 -1 -1.00993e-8 0.3826836 -0.9238795 1.00993e-8 0.707107 -0.7071066 2.52483e-9 0.9238797 -0.382683 1.00993e-8 1 6.48882e-7 -1.5149e-8 0.9238792 0.3826841 -1.5149e-8 0.7071061 0.7071075 -2.52483e-9 0.3826826 0.9238799 2.27235e-8 -0.354855 0.8566955 -0.374367 -2.71501e-7 0.9272805 -0.374367 -0.6556864 0.6556864 -0.374367 -0.8566955 0.354855 -0.374367 -0.9272807 1.29466e-7 -0.374367 -0.8566957 -0.3548547 -0.3743671 -0.6556866 -0.6556862 -0.3743671 -0.3548551 -0.8566955 -0.3743671 1.00556e-7 -0.9272806 -0.374367 0.3548551 -0.8566956 -0.374367 0.6556866 -0.6556863 -0.374367 0.8566957 -0.3548546 -0.3743671 0.9272806 6.07107e-7 -0.3743671 0.8566952 0.3548556 -0.374367 0.6556858 0.655687 -0.3743671 0.3548542 0.8566959 -0.3743671 -0.2750952 0.6641383 -0.6951568 -2.46039e-7 0.7188582 -0.6951568 -0.5083096 0.5083095 -0.6951566 -0.6641383 0.2750952 -0.6951566 -0.7188582 1.09972e-7 -0.6951567 -0.6641384 -0.275095 -0.6951566 -0.5083097 -0.5083094 -0.6951566 -0.2750952 -0.6641384 -0.6951567 7.64212e-8 -0.7188582 -0.6951567 0.2750953 -0.6641383 -0.6951566 0.5083096 -0.5083094 -0.6951567 0.6641385 -0.2750948 -0.6951566 0.7188582 4.95184e-7 -0.6951568 0.6641382 0.2750957 -0.6951567 0.5083091 0.5083101 -0.6951567 0.2750946 0.6641386 -0.6951566 -0.154257 0.3724091 -0.9151592 -1.51258e-7 0.4030926 -0.9151592 -0.2850295 0.2850295 -0.9151592 -0.3724091 0.1542569 -0.9151592 -0.4030926 7.89972e-8 -0.9151592 -0.372409 -0.1542568 -0.9151592 -0.2850296 -0.2850295 -0.9151592 -0.1542569 -0.3724091 -0.9151592 3.06191e-8 -0.4030927 -0.9151592 0.154257 -0.3724091 -0.9151592 0.2850296 -0.2850295 -0.9151592 0.3724092 -0.1542567 -0.9151592 0.4030927 2.96393e-7 -0.9151592 0.372409 0.1542572 -0.9151592 0.2850293 0.2850298 -0.9151592 0.1542566 0.3724092 -0.9151592 1.23395e-9 1.23395e-9 -1</float_array>
          <technique_common>
            <accessor source="#geom-Sphere-normals-array" count="114" stride="3">
              <param name="X" type="float"/>
              <param name="Y" type="float"/>
              <param name="Z" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <source id="geom-Sphere-map1">
          <float_array id="geom-Sphere-map1-array" count="372">0.5 1 0.999001 0.9999999 0.8749999 0.999001 0.06249999 0.8749999 0.999001 0.125 0.8749999 0.999001 0.1875 0.8749999 0.999001 0.2499999 0.8749999 0.999001 0.3124999 0.8749999 0.999001 0.3749999 0.8749999 0.999001 0.4374999 0.8749999 0.999001 0.5 0.8749999 0.999001 0.5625 0.8749999 0.999001 0.625 0.8749999 0.999001 0.6875001 0.8749999 0.999001 0.7500001 0.8749999 0.999001 0.8125001 0.8749999 0.999001 0.8750001 0.8749999 0.999001 0.9375001 0.8749999 0.999001 0.9999999 0.75 0.999001 0.06249999 0.75 0.999001 0.125 0.75 0.999001 0.1875 0.75 0.999001 0.2499999 0.75 0.999001 0.3124999 0.75 0.999001 0.3749999 0.75 0.999001 0.4374999 0.75 0.999001 0.5 0.75 0.999001 0.5625 0.75 0.999001 0.625 0.75 0.999001 0.6875001 0.75 0.999001 0.7500001 0.75 0.999001 0.8125001 0.75 0.999001 0.8750001 0.75 0.999001 0.9375001 0.75 0.999001 0.9999999 0.625 0.999001 0.06249999 0.625 0.999001 0.125 0.625 0.999001 0.1875 0.625 0.9990011 0.2499999 0.625 0.999001 0.3124999 0.625 0.9990011 0.3749999 0.625 0.9990011 0.4374999 0.625 0.9990011 0.5 0.625 0.999001 0.5625 0.625 0.999001 0.625 0.625 0.999001 0.6875001 0.625 0.999001 0.7500001 0.625 0.999001 0.8125001 0.625 0.999001 0.8750001 0.625 0.9990011 0.9375001 0.625 0.9990011 0.9999999 0.5 0.999001 0.06249999 0.5 0.999001 0.125 0.5 0.999001 0.1875 0.5 0.999001 0.2499999 0.5 0.999001 0.3124999 0.5 0.999001 0.3749999 0.5 0.9990011 0.4374999 0.5 0.9990011 0.5 0.5 0.999001 0.5625 0.5 0.999001 0.625 0.5 0.999001 0.6875001 0.5 0.9990011 0.7500001 0.5 0.999001 0.8125001 0.5 0.9990011 0.8750001 0.5 0.9990011 0.9375001 0.5 0.9990011 0.9999999 0.3749999 0.999001 0.06249999 0.375 0.9990011 0.125 0.3749999 0.999001 0.1875 0.375 0.9990011 0.2499999 0.3749999 0.999001 0.3124999 0.375 0.9990011 0.3749999 0.375 0.9990011 0.4374999 0.375 0.9990011 0.5 0.3749999 0.999001 0.5625 0.375 0.9990011 0.625 0.375 0.9990011 0.6875001 0.375 0.9990011 0.7500001 0.3749999 0.999001 0.8125001 0.3749999 0.999001 0.8750001 0.375 0.9990011 0.9375001 0.375 0.9990011 0.9999999 0.25 0.999001 0.06249999 0.25 0.999001 0.125 0.25 0.999001 0.1875 0.25 0.999001 0.2499999 0.25 0.999001 0.3124999 0.25 0.999001 0.3749999 0.25 0.999001 0.4374999 0.25 0.999001 0.5 0.25 0.999001 0.5625 0.25 0.999001 0.625 0.25 0.999001 0.6875001 0.25 0.999001 0.7500001 0.25 0.999001 0.8125001 0.25 0.999001 0.8750001 0.25 0.999001 0.9375001 0.25 0.999001 0.9999999 0.125 0.999001 0.06249999 0.125 0.999001 0.125 0.125 0.999001 0.1875 0.125 0.999001 0.2499999 0.125 0.999001 0.3124999 0.125 0.999001 0.3749999 0.125 0.999001 0.4374999 0.125 0.999001 0.5 0.125 0.999001 0.5625 0.125 0.999001 0.625 0.125 0.999001 0.6875001 0.125 0.999001 0.7500001 0.125 0.999001 0.8125001 0.125 0.999001 0.8750001 0.125 0.999001 0.9375001 0.125 0.999001 0.5 0 0.999001 1.0625 0.8749999 0.999001 1.5 1 0.999001 1.0625 0.75 0.999001 1.0625 0.625 0.999001 1.0625 0.5 0.999001 1.0625 0.375 0.9990011 1.0625 0.25 0.999001 1.0625 0.125 0.999001 -5.96046e-8 0.125 0.999001 -0.5 0 0.999001</float_array>
          <technique_common>
            <accessor source="#geom-Sphere-map1-array" count="124" stride="3">
              <param name="S" type="float"/>
              <param name="T" type="float"/>
              <param name="P" type="float"/>
            </accessor>
          </technique_common>
        </source>
        <vertices id="geom-Sphere-vertices">
          <input semantic="POSITION" source="#geom-Sphere-positions"/>
        </vertices>
        <triangles material="ColorMaterial" count="224">
          <input semantic="VERTEX" source="#geom-Sphere-vertices" offset="0"/>
          <input semantic="NORMAL" source="#geom-Sphere-normals" offset="1"/>
          <input semantic="TEXCOORD" source="#geom-Sphere-map1" offset="2" set="0"/>
          <p>0 0 115 1 1 1 2 2 114 0 0 0 2 2 2 3 3 3 0 0 0 3 3 3 4 4 4 0 0 0 4 4 4 5 5 5 0 0 0 5 5 5 6 6 6 0 0 0 6 6 6 7 7 7 0 0 0 7 7 7 8 8 8 0 0 0 8 8 8 9 9 9 0 0 0 9 9 9 10 10 10 0 0 0 10 10 10 11 11 11 0 0 0 11 11 11 12 12 12 0 0 0 12 12 12 13 13 13 0 0 0 13 13 13 14 14 14 0 0 0 14 14 14 15 15 15 0 0 0 15 15 15 16 16 16 0 0 0 16 16 16 1 1 1 18 17 116 2 2 114 1 1 1 1 1 1 17 18 17 18 17 116 19 19 19 3 3 3 2 2 2 2 2 2 18 17 18 19 19 19 20 20 20 4 4 4 3 3 3 3 3 3 19 19 19 20 20 20 21 21 21 5 5 5 4 4 4 4 4 4 20 20 20 21 21 21 22 22 22 6 6 6 5 5 5 5 5 5 21 21 21 22 22 22 23 23 23 7 7 7 6 6 6 6 6 6 22 22 22 23 23 23 24 24 24 8 8 8 7 7 7 7 7 7 23 23 23 24 24 24 25 25 25 9 9 9 8 8 8 8 8 8 24 24 24 25 25 25 26 26 26 10 10 10 9 9 9 9 9 9 25 25 25 26 26 26 27 27 27 11 11 11 10 10 10 10 10 10 26 26 26 27 27 27 28 28 28 12 12 12 11 11 11 11 11 11 27 27 27 28 28 28 29 29 29 13 13 13 12 12 12 12 12 12 28 28 28 29 29 29 30 30 30 14 14 14 13 13 13 13 13 13 29 29 29 30 30 30 31 31 31 15 15 15 14 14 14 14 14 14 30 30 30 31 31 31 32 32 32 16 16 16 15 15 15 15 15 15 31 31 31 32 32 32 17 18 17 1 1 1 16 16 16 16 16 16 32 32 32 17 18 17 34 33 117 18 17 116 17 18 17 17 18 17 33 34 33 34 33 117 35 35 35 19 19 19 18 17 18 18 17 18 34 33 34 35 35 35 36 36 36 20 20 20 19 19 19 19 19 19 35 35 35 36 36 36 37 37 37 21 21 21 20 20 20 20 20 20 36 36 36 37 37 37 38 38 38 22 22 22 21 21 21 21 21 21 37 37 37 38 38 38 39 39 39 23 23 23 22 22 22 22 22 22 38 38 38 39 39 39 40 40 40 24 24 24 23 23 23 23 23 23 39 39 39 40 40 40 41 41 41 25 25 25 24 24 24 24 24 24 40 40 40 41 41 41 42 42 42 26 26 26 25 25 25 25 25 25 41 41 41 42 42 42 43 43 43 27 27 27 26 26 26 26 26 26 42 42 42 43 43 43 44 44 44 28 28 28 27 27 27 27 27 27 43 43 43 44 44 44 45 45 45 29 29 29 28 28 28 28 28 28 44 44 44 45 45 45 46 46 46 30 30 30 29 29 29 29 29 29 45 45 45 46 46 46 47 47 47 31 31 31 30 30 30 30 30 30 46 46 46 47 47 47 48 48 48 32 32 32 31 31 31 31 31 31 47 47 47 48 48 48 33 34 33 17 18 17 32 32 32 32 32 32 48 48 48 33 34 33 50 49 118 34 33 117 33 34 33 33 34 33 49 50 49 50 49 118 51 51 51 35 35 35 34 33 34 34 33 34 50 49 50 51 51 51 52 52 52 36 36 36 35 35 35 35 35 35 51 51 51 52 52 52 53 53 53 37 37 37 36 36 36 36 36 36 52 52 52 53 53 53 54 54 54 38 38 38 37 37 37 37 37 37 53 53 53 54 54 54 55 55 55 39 39 39 38 38 38 38 38 38 54 54 54 55 55 55 56 56 56 40 40 40 39 39 39 39 39 39 55 55 55 56 56 56 57 57 57 41 41 41 40 40 40 40 40 40 56 56 56 57 57 57 58 58 58 42 42 42 41 41 41 41 41 41 57 57 57 58 58 58 59 59 59 43 43 43 42 42 42 42 42 42 58 58 58 59 59 59 60 60 60 44 44 44 43 43 43 43 43 43 59 59 59 60 60 60 61 61 61 45 45 45 44 44 44 44 44 44 60 60 60 61 61 61 62 62 62 46 46 46 45 45 45 45 45 45 61 61 61 62 62 62 63 63 63 47 47 47 46 46 46 46 46 46 62 62 62 63 63 63 64 64 64 48 48 48 47 47 47 47 47 47 63 63 63 64 64 64 49 50 49 33 34 33 48 48 48 48 48 48 64 64 64 49 50 49 66 65 119 50 49 118 49 50 49 49 50 49 65 66 65 66 65 119 67 67 67 51 51 51 50 49 50 50 49 50 66 65 66 67 67 67 68 68 68 52 52 52 51 51 51 51 51 51 67 67 67 68 68 68 69 69 69 53 53 53 52 52 52 52 52 52 68 68 68 69 69 69 70 70 70 54 54 54 53 53 53 53 53 53 69 69 69 70 70 70 71 71 71 55 55 55 54 54 54 54 54 54 70 70 70 71 71 71 72 72 72 56 56 56 55 55 55 55 55 55 71 71 71 72 72 72 73 73 73 57 57 57 56 56 56 56 56 56 72 72 72 73 73 73 74 74 74 58 58 58 57 57 57 57 57 57 73 73 73 74 74 74 75 75 75 59 59 59 58 58 58 58 58 58 74 74 74 75 75 75 76 76 76 60 60 60 59 59 59 59 59 59 75 75 75 76 76 76 77 77 77 61 61 61 60 60 60 60 60 60 76 76 76 77 77 77 78 78 78 62 62 62 61 61 61 61 61 61 77 77 77 78 78 78 79 79 79 63 63 63 62 62 62 62 62 62 78 78 78 79 79 79 80 80 80 64 64 64 63 63 63 63 63 63 79 79 79 80 80 80 65 66 65 49 50 49 64 64 64 64 64 64 80 80 80 65 66 65 82 81 120 66 65 119 65 66 65 65 66 65 81 82 81 82 81 120 83 83 83 67 67 67 66 65 66 66 65 66 82 81 82 83 83 83 84 84 84 68 68 68 67 67 67 67 67 67 83 83 83 84 84 84 85 85 85 69 69 69 68 68 68 68 68 68 84 84 84 85 85 85 86 86 86 70 70 70 69 69 69 69 69 69 85 85 85 86 86 86 87 87 87 71 71 71 70 70 70 70 70 70 86 86 86 87 87 87 88 88 88 72 72 72 71 71 71 71 71 71 87 87 87 88 88 88 89 89 89 73 73 73 72 72 72 72 72 72 88 88 88 89 89 89 90 90 90 74 74 74 73 73 73 73 73 73 89 89 89 90 90 90 91 91 91 75 75 75 74 74 74 74 74 74 90 90 90 91 91 91 92 92 92 76 76 76 75 75 75 75 75 75 91 91 91 92 92 92 93 93 93 77 77 77 76 76 76 76 76 76 92 92 92 93 93 93 94 94 94 78 78 78 77 77 77 77 77 77 93 93 93 94 94 94 95 95 95 79 79 79 78 78 78 78 78 78 94 94 94 95 95 95 96 96 96 80 80 80 79 79 79 79 79 79 95 95 95 96 96 96 81 82 81 65 66 65 80 80 80 80 80 80 96 96 96 81 82 81 98 97 121 82 81 120 81 82 81 81 82 81 97 98 97 98 97 121 99 99 99 83 83 83 82 81 82 82 81 82 98 97 98 99 99 99 100 100 100 84 84 84 83 83 83 83 83 83 99 99 99 100 100 100 101 101 101 85 85 85 84 84 84 84 84 84 100 100 100 101 101 101 102 102 102 86 86 86 85 85 85 85 85 85 101 101 101 102 102 102 103 103 103 87 87 87 86 86 86 86 86 86 102 102 102 103 103 103 104 104 104 88 88 88 87 87 87 87 87 87 103 103 103 104 104 104 105 105 105 89 89 89 88 88 88 88 88 88 104 104 104 105 105 105 106 106 106 90 90 90 89 89 89 89 89 89 105 105 105 106 106 106 107 107 107 91 91 91 90 90 90 90 90 90 106 106 106 107 107 107 108 108 108 92 92 92 91 91 91 91 91 91 107 107 107 108 108 108 109 109 109 93 93 93 92 92 92 92 92 92 108 108 108 109 109 109 110 110 110 94 94 94 93 93 93 93 93 93 109 109 109 110 110 110 111 111 111 95 95 95 94 94 94 94 94 94 110 110 110 111 111 111 112 112 112 96 96 96 95 95 95 95 95 95 111 111 111 112 112 112 97 98 97 81 82 81 96 96 96 96 96 96 112 112 112 97 98 97 113 113 123 98 97 98 97 98 122 113 113 113 99 99 99 98 97 98 113 113 113 100 100 100 99 99 99 113 113 113 101 101 101 100 100 100 113 113 113 102 102 102 101 101 101 113 113 113 103 103 103 102 102 102 113 113 113 104 104 104 103 103 103 113 113 113 105 105 105 104 104 104 113 113 113 106 106 106 105 105 105 113 113 113 107 107 107 106 106 106 113 113 113 108 108 108 107 107 107 113 113 113 109 109 109 108 108 108 113 113 113 110 110 110 109 109 109 113 113 113 111 111 111 110 110 110 113 113 113 112 112 112 111 111 111 113 113 113 97 98 97 112 112 112</p>
        </triangles>
      </mesh>
    </geometry>
  </library_geometries>
  <library_cameras>
    <camera id="Camera-camera" name="Camera">
      <optics>
        <technique_common>
          <perspective>
            <xfov>45</xfov>
            <znear>1</znear>
            <zfar>1000</zfar>
          </perspective>
        </technique_common>
      </optics>
      <extra>
        <technique profile="OpenCOLLADA3dsMax">
          <target>#CameraTarget</target>
        </technique>
      </extra>
    </camera>
  </library_cameras>
  <library_lights>
    <light id="EnvironmentAmbientLight" name="EnvironmentAmbientLight">
      <technique_common>
        <ambient>
          <color>0 0 0</color>
        </ambient>
      </technique_common>
    </light>
    <light id="Omni-light" name="Omni">
      <technique_common>
        <point>
          <color>1 1 1</color>
          <constant_attenuation>1</constant_attenuation>
          <linear_attenuation>0</linear_attenuation>
          <quadratic_attenuation>0</quadratic_attenuation>
        </point>
      </technique_common>
      <extra>
        <technique profile="OpenCOLLADA3dsMax">
          <max_light>
            <aspect_ratio>80</aspect_ratio>
            <atmosphere_on>1</atmosphere_on>
            <atmosphere_opacity>0</atmosphere_opacity>
            <attenuation_far_end>0</attenuation_far_end>
            <attenuation_near_end>40</attenuation_near_end>
            <attenuation_near_start>200</attenuation_near_start>
            <contrast>0</contrast>
            <decay_falloff>1</decay_falloff>
            <decay_type>0</decay_type>
            <diffuse_soften>0</diffuse_soften>
            <falloff>40</falloff>
            <hotspot_beam>0</hotspot_beam>
            <multiplier>1</multiplier>
            <shadow_color>1</shadow_color>
            <use_far_attenuation>0</use_far_attenuation>
            <use_near_attenuation>0</use_near_attenuation>
          </max_light>
        </technique>
      </extra>
    </light>
  </library_lights>
  <library_visual_scenes>
    <visual_scene id="MaxScene">
      <node name="EnvironmentAmbientLight">
        <instance_light url="#EnvironmentAmbientLight"/>
      </node>
      <node id="node-Walls" name="Walls">
        <translate>0 0 25</translate>
        <node>
          <matrix>1 0 0 0 0 1 0 0 0 0 1 -25 0 0 0 1</matrix>
          <instance_geometry url="#geom-Walls">
            <bind_material>
              <technique_common>
                <instance_material symbol="ColorMaterial" target="#ColorEffectR85G28B177-material"/>
              </technique_common>
            </bind_material>
          </instance_geometry>
        </node>
      </node>
      <node id="node-Omni" name="Omni">
        <translate>-30.14952 -25.73263 13.2969</translate>
        <instance_light url="#Omni-light"/>
      </node>
      <node id="node-Camera" name="Camera">
        <matrix>0.1019664 -0.3402375 0.9347948 246.7445 0.9947879 0.03487454 -0.09581703 -20.45061 0 0.9396926 0.3420201 105.2852 0 0 0 1</matrix>
        <instance_camera url="#Camera-camera"/>
      </node>
      <node id="node-CameraTarget" name="CameraTarget">
        <translate>4.262589 4.403932 16.5666</translate>
      </node>
      <node id="node-Sphere" name="Sphere">
        <translate>-10.52007 31.13398 9.212278</translate>
        <instance_geometry url="#geom-Sphere">
          <bind_material>
            <technique_common>
              <instance_material symbol="ColorMaterial" target="#ColorEffectR138G8B110-material"/>
            </technique_common>
          </bind_material>
        </instance_geometry>
      </node>
    </visual_scene>
  </library_visual_scenes>
  <scene>
    <instance_visual_scene url="#MaxScene"/>
  </scene>
</COLLADA>
Any clues?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Collada Full Scene

Post by CuteAlien »

Thanks for the test-case. The problem seems to be that Irrlicht doesn't support right now camera instanced inside library_visual_scenes. So you have to move it to <scene> for now. I suspect this is probably a bug, but can't tell on a quick view how hard it's going to be to fix it (just a quick check at lunch-time, will have to look at this in the evening).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
NemoStein
Posts: 17
Joined: Mon Aug 11, 2008 12:04 am

Re: Collada Full Scene

Post by NemoStein »

CuteAlien,

Thank you, but moving the camera node to <scene> didn't solve the problem...
Moving the whole <visual_scene> (it's contents) to <scene> mess with the position of nodes.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Collada Full Scene

Post by CuteAlien »

Hm, no idea why it wasn't instantiated before - there was simply the check for "instance_camera" missing, but was otherwise coded already. I've added it to svn trunk (r4609)- which means it will be in Irrlicht 1.9. Sorry that it won't be in Irrlicht 1.8.2 which will be released in 1-2 weeks, but it might be I missed something in the camera-instantiation which allowed the code to be called in another way. And I made another tiny change to prevent camera-switches on loading Colladas so I can't just add it in a bugfix release anymore. But I think Irrlicht Lime is using trunk anyway, so you might get the fix even faster that way :-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
NemoStein
Posts: 17
Joined: Mon Aug 11, 2008 12:04 am

Re: Collada Full Scene

Post by NemoStein »

Thx!
Lime is updated "sometimes", so I don't know when I'll get these changes... And I won't fiddle with C++ (I tried before, don't get me wrong, I just can't handle those compiler mess).
Anyway, glad it's fixed (why didn't anybody stumbled on it before?).
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Collada Full Scene

Post by CuteAlien »

Well, maybe people did stumble upon it, but just gave up. We're not getting such nice test-files every day :-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply