I'm writing a program that can show 3D models upon request, with an ability to rotate/zoom them easily. Models come from Solid Works, and so far I only managed to convert them to COLLADA (via Solid Works' COLLADA export plugin). Now I'm looking for a library to do the viewing/rotating part, and considering Irrlicht.
So, I tried to just open up the model with Meshviewer example, that's supposed to support COLLADA, but failed: loading is finished without errors, but nothing is displayed. Now, I'm not sure Irrlicht is really to blame for this, as both Solid Works and COLLADA export plugin are proprietary and probably cannot be trusted to create proper COLLADA. However, I tried importing the same model in blender, and it works fine, so at least even if it's imperfect, it's recoverable.
Why can't Irrlicht's Meshviewer load it? Please, can you help me to actually open this model in Meshviewer, or modify Meshviewer to open them, or modify them to be opened in Meshviewer? In the latter case I need to know how to fix the models, not get the fixed model, of course.
Here's are links to an example model and to the Meshviewer's stdout and stderr:
http://dl.dropbox.com/u/20069183/meshvi ... adster.dae [12.0 MB]
http://dl.dropbox.com/u/20069183/meshvi ... viewer.log [40.9 KB]
(I cannot make these links clickable, can I? [url] seems to be disabled.)
Also, I'm running Ubuntu 11.04 and Windows 7 and Irrlicht-1.7.2 from the downloads page.
I cannot load a specific COLLADA mesh with Meshviewer
Re: I cannot load a specific COLLADA mesh with Meshviewer
I get a single wheel when loading it. And it's very small and zoom for it does not work in meshviewer because collada-files are by default loaded as scene and not as node (and yeah - we have to think about how to solve that better - it makes sense, but zoom not working is certainly confusing right now). Search for the line with "scene::COLLADA_CREATE_SCENE_INSTANCES" and outcomment that, then you can zoom it.
edit: Ok, I just got it loading in Blender and see that there should be more than a single wheel obviously. I move the thread to bugreports.
edit: Ok, I just got it loading in Blender and see that there should be more than a single wheel obviously. I move the thread to bugreports.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Re: I cannot load a specific COLLADA mesh with Meshviewer
Just was thinking about it some more - most likely it is only a scale problem. When COLLADA_CREATE_SCENE_INSTANCES is disabled it only loads the first object in the collada file - and I suppose the roadster isn't a single object but consists of several objects. Collada scene loading is unfortunately using the meshloading mechanisms so far instead of being a sceneloader and so I don't know a simply workaround at the moment. You could scale every sub-object of the rootscenenode - this would probably work in this case. Or you can scale the collada larger inside your modeling tool. Or use other camera-settings.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: I cannot load a specific COLLADA mesh with Meshviewer
If create scene instances is set, it is simply instantiating every component that is found in the file. Otherwise the scene tag is used as the root node. Only models instantiated there will be created in the scene. All other meshes are stored in the mesh cache, though.
In most cases, the loader will not properly work due to file order problems. I wrongly read the collada specs that a certain order in the file has to be obeyed. But that's not the case, and I am currently rewriting the loader to work also with meshes and materials being used before being instantiated. Once this is done, I will rewrite the loader for the new scene loader interface. But most objects will have a single root node also when being loaded with the current mesh loader, as lots of dummy nodes are created from the file hierarchy. So scaling the top node would be enough to scale the whole object.
BTW: Next time posting you should be able to make your links clickable. This is only disabled for first time posters in order to stop spammers posting links immediately.
In most cases, the loader will not properly work due to file order problems. I wrongly read the collada specs that a certain order in the file has to be obeyed. But that's not the case, and I am currently rewriting the loader to work also with meshes and materials being used before being instantiated. Once this is done, I will rewrite the loader for the new scene loader interface. But most objects will have a single root node also when being loaded with the current mesh loader, as lots of dummy nodes are created from the file hierarchy. So scaling the top node would be enough to scale the whole object.
BTW: Next time posting you should be able to make your links clickable. This is only disabled for first time posters in order to stop spammers posting links immediately.
Re: I cannot load a specific COLLADA mesh with Meshviewer
Not sure if Collada has a top-node, that's why I suppose all children of the rootscenenode have to be scaled. The first node is simply a wheel in this case.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: I cannot load a specific COLLADA mesh with Meshviewer
That's not a general requirement, but all of the files I've seen so far do have many dummy nodes inside. This one, though, has not. It instantiates all nodes on a top-level. Not sure why it does not show the other nodes, though, as the order of nodes seems to be ok.
Re: I cannot load a specific COLLADA mesh with Meshviewer
Yeah - that's what I meant above - it does show them. It's just showing them so small in the meshviewer that we don't see it. And we can't scale scenes so far. So it's probably all OK- except that it's too small to see. And when I disable COLLADA_CREATE_SCENE_INSTANCES then it loads no longer a scene but just one model - so I can scale that and after scaling it is visible.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm