Page 1 of 1

3d scenes/objects not properly displayed

Posted: Wed Jun 20, 2012 5:48 am
by iLLuSia
i just started with irrlicht and using blender to make some rooms, exporting them to .dae files, loading them up in the example with the collision (its the 7th i think). its nothing fancy, because i started with blender, too, but although im doing the same stuff again, irrlicht is displaying it differently. example: ive created room1 and room2 with blender more or less the same way, didnt change anything in the code, but room1 was centered on load, room 2 was like miles away. room1 was more or less normally scaled, room2 was thin and extremly tall. and the objects, or some faces of it, sometimes just disappear, when i look at them from different angles. tried exporting to different files: 3ds, obj... sometimes different, but of course not better results.

i loaded them up in raw opengl (glu32, glut32 and so on... got some knowledge there) and they looked pretty much normal: correctly placed and scaled (only triangulation wasnt activated, so they had some holes...). So what is going on with irrlicht? did i miss something important?

help, plz...?

Re: 3d scenes/objects not properly displayed

Posted: Wed Jun 20, 2012 2:53 pm
by CuteAlien
I would recommend using the meshloader example (example 9) for a start - that allows faster testing. Can't really say much about concrete problems without having screenshots - or better - the model itself.

I think there a fix in .dae loading in the newest svn trunk version of Irrlicht compared to Irrlicht 1.7, so it might be worth checking that one out. If you can post the model (maybe even with .blend files?) then I would check them out (I'm interested a lot in .dae problems as I'm using the format myself sometimes recently).

Re: 3d scenes/objects not properly displayed

Posted: Wed Jun 20, 2012 8:08 pm
by iLLuSia
Here they are. Like i said - nothing fancy, I wanted to test it before making complicated things, of course.
Imageroom1
Imageroom2
The first room is pretty big too, somehow they are differently scaled, though no change in the code.

here are all files:
https://rapidshare.com/files/4270234171/rooms.rar

The Meshviewer displays them correctly - more or less. They are placed far away, but at least properly scaled :O

Re: 3d scenes/objects not properly displayed

Posted: Wed Jun 20, 2012 9:12 pm
by CuteAlien
Difference is probably that the meshviewer has that line:

Code: Select all

 
smgr->getParameters()->setAttribute(scene::COLLADA_CREATE_SCENE_INSTANCES, true);
 
By default the collada-loader just loads the first mesh. That line is a trick to allow loading whole collada-scenes as a mesh (yeah, that's not nice, but no-one rewrote it so far). That trick is btw. also the reason why the scale-button in the meshviewer doesn't work for collada-scenes - if you export with .obj files it's easier to see different scales. Maybe also enable normals in the meshviewer to check if those are exported all correct.

And well scale - units are units they don't mean anything without a camera (you get closer stuff gets bigger...).

There is clipping going on for near- and far-plane of the camera when objects are too close or too far.

Re: 3d scenes/objects not properly displayed

Posted: Thu Jun 21, 2012 5:58 pm
by iLLuSia
Well... this makes it display properly, but now everything is unscaleable and untransformable. I guess, I have to set some attributes every mesh how to scale them and where to transform, etc...

Maybe a different file format or programm helps?

Re: 3d scenes/objects not properly displayed

Posted: Thu Jun 21, 2012 10:51 pm
by CuteAlien
Yes, that's unfortunately a problem with collada-scenes so far. I hope we can fix this for 1.9, but won't be changed anymore before Irrlicht 1.8 release.

I would use .obj format for static scenes. You wrote you had some problems with those as well, but I got not too bad results when I did a quick test with those (after scaling). You probably need a few tries until you find good export settings and have sane lighting in your scene.

Re: 3d scenes/objects not properly displayed

Posted: Fri Jun 22, 2012 8:11 am
by hybrid
Usually, the collada scenes get a main node (or you can load them below an empty scene node at least). Then simply set scale and position on this node, which will work for all the underlying stuff as well due to parenting.

Re: 3d scenes/objects not properly displayed

Posted: Fri Jun 22, 2012 8:16 am
by CuteAlien
@hybrid: I thought so as well first, but it seems you can't set a parent-node as the whole scene-loading stuff for collada is just a hack in the meshloader. It simply uses the SceneManager as parent.

Setting a node as parent only works for our real sceneloader (the .irr files). Bascially we should have a sceneloading interface probably then we could support that in a clean way for collada as well. But let's get 1.8 released first.

Re: 3d scenes/objects not properly displayed

Posted: Fri Jun 22, 2012 12:34 pm
by hybrid
Ah right, you cannot pass a parent node to the mesh loader (could be another godd idea for 1.9, though). But there's a dummy scene node created - at least the older collada loaders did so.

Re: 3d scenes/objects not properly displayed

Posted: Fri Jun 22, 2012 9:45 pm
by iLLuSia
Well, there's something wrong with the 2nd room anyway. Even if I'm finally placed inside the room after thousand rescales, I can't move, like in the first one. Gotta give it some more tries. Thx for the help so far.

What formats are you guys using for 3d-scenery btw? And what programms to create them?

Re: 3d scenes/objects not properly displayed

Posted: Sat Jun 23, 2012 10:10 am
by CuteAlien
For import I use mostly .obj for static scenes and .b3d or .X for animations. For export (when I want to render my Irrlichts-scenes in other tools) I use collada. But haven't worked much with Blender since the 2.5 version (still haven't found time to re-learn using it), so no experience yet with that.