irrlicht behaves differently depending on the file type

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
PixelBender
Posts: 7
Joined: Thu Oct 20, 2016 8:30 am

irrlicht behaves differently depending on the file type

Post by PixelBender »

Hi,

first: I did my first steps in irrlicht years ago.
For a new project I remembered it and now I'm actually working with it.

If an admin is listening:
I've forgotten my former account to the forum.
Therefore I wanted to create a new one and when entered my email address
it says that it is already in use.

"Fine", I thought, "lets use the old account" .
But in order to reset my old password, I not only need the email address but also
my old username that I've forgotten.

I ended up creating a new email address just in order to be able to use this forum.

But now to the technical question:

To start my project I just reused one of the examples coming with the irrlich SDK:
09. MeshViewer

Since I need OpenGl I hardcoded this driver circumventing the user chooseable options at program startup.
In order to have a better orientation in 3d space I created those three red green blue arrows representing the x-,y-,z axis in blender
and exported this model as Collada *.dae, Wavefront *.obj, and *.3ds.

I added a new tab in the Toolset GUI in order to have scrollbars for the position and the rotation of the loaded model.

The Collada Model looks best even with the transparent sphere I used in the origin of the little coordinate system,
but it doesn't react to the movement of the scrollbars.

The 3ds-Model reacts to the scrollbars but the sphere is not transparent and also the shading and the segments of the arrows is not visible just plain colors.

In the *.obj Model the sphere ist transparent but the material of the arrows is also just of flat colors. While the scrollbars have an effect to the obj-model.

The event handling looks as following:

Code: Select all

else if (id == GUI_ID_SCROLLBAR_X_POSITION)
                {
                     const s32 pos = ((IGUIScrollBar*)event.GUIEvent.Caller)->getPos();
                     core::vector3df position;
                     if (Model)
                     {
                          position = Model->getAbsolutePosition();
                          position.X = ((f32)pos);
                          Model->setPosition(position);
                     }
                }
Nothing special: when it catches the event that the x-Position scrollbar is moved it gets the value from the scrollbar.
if a model is not NULL the absolute position is get than the new x-position is set and afterwards the model is positioned at its new location.

Anybody knows, why irrlicht behaves differently according to the loaded file type?

Greetings
Markus
CuteAlien
Admin
Posts: 9629
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: irrlicht behaves differently depending on the file type

Post by CuteAlien »

Phew, different materials can have different reasons. Basically export/import of materials might not be fully supported (or doing the exact same thing) on either blender or Irrlicht side. Can only test by checking per example which options are exported/imported by which model. If you put all models online I might take a look (but no promise I see the differences easily).

Note that you can modify material-settings after loading and generally will have to do that often.

The Collada problem likely has another origin. Basically Collada loader is using some hacks. Collada is a scene-format - not a mesh-format. But in Irrlicht (for pure historical reasons - aka programmer back then just did it like that...) it uses the meshloader interface. But Collada usually has scenes, so there is a hack to load complete scene instead (and not returning a valid mesh at all, but simply filling the scenemanager instead) which is used in the example 09 with that line:

Code: Select all

 
smgr->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true);
 
Try again when you disable that - then it should try to load the first mesh and behave like other meshloaders otherwise I think.
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
PixelBender
Posts: 7
Joined: Thu Oct 20, 2016 8:30 am

Re: irrlicht behaves differently depending on the file type

Post by PixelBender »

Hi,

Setting the flag to false in the statement you mentioned did the trick.
thank you very much!

Greetings
Markus
Post Reply