Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3509 Members - Latest Member: lioneltenel

27. May 2012, 01:21:52 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)COLLADALoader()
Pages: [1]
Print
Author Topic: COLLADALoader()  (Read 1639 times)
avedakadevra
Just dropped in

Offline Offline

Posts: 5


View Profile
« on: 30. September 2007, 07:58:35 pm »

The goal of the exercise is to put some 'file' viewer inside Eclipse.
I am trying first with COLLADA. I am using 'SVN' trunck.

I try something like this just to test drive:

   
Code:
private BranchGroup createScene(String daeFile) throws Exception {
BranchGroup bg = new BranchGroup();

AssetFolder root = new COLLADALoader().load(daeFile);
LibraryVisualScenes scenes = root.getLibraryVisualsScenes();
Iterator<Scene> itScene = scenes.getScenes().values().iterator();
if (itScene.hasNext()) {
Scene myScene = itScene.next();
if(myScene.getNodes().values().iterator().hasNext()) {
Node myNode = myScene.getNodes().values().iterator().next();
Model myDaeModelFile = new Model(myNode,null);
bg.addChild(myDaeModelFile);
}
}
return bg;
}

When called, I get the following exception :

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamException
   at java.lang.Class.getDeclaredMethods0(Native Method)
   at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
   at java.lang.Class.getMethod0(Unknown Source)
   at java.lang.Class.getMethod(Unknown Source)
   at org.jibx.runtime.impl.UnmarshallingContext.createReaderFactory(UnmarshallingContext.java:187)
   at org.jibx.runtime.impl.UnmarshallingContext.<clinit>(UnmarshallingContext.java:73)
   at org.jagatoo.loaders.models.collada.jibx.JiBX_bindingFactory.createUnmarshallingContext()
   at org.jagatoo.loaders.models.collada.COLLADALoader.<init>(COLLADALoader.java:52)
   at org.xith3d.test.XithTest.createScene(XithTest.java:45)
   at org.xith3d.test.XithTest.<init>(XithTest.java:104)
   at org.xith3d.test.XithTest.main(XithTest.java:112)

I guess I am missing something. But what ?

Best regards,

Sebastien.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 30. September 2007, 08:04:05 pm »

hi, avedakadevra. Welcome to Xith3D Smiley.

No, you're not missing anything. Well, this exception wouldn't come up, if you were using Java 1.6 (don't be alarmed. Xith is supposed to be Java 1.5 compatible). But there are simply two jars missing in the trunk, that are needed to use the COLLADA loader with Java 1.5. This loader is not yet ready. We're all waiting patiently for it to be completed Smiley. When it is complete, these missing-jars troubles will also be eliminated. So please wait a bit until it is completed. Could you maybe use one of Xith's other loaders?

Marvin
Logged
avedakadevra
Just dropped in

Offline Offline

Posts: 5


View Profile
« Reply #2 on: 01. October 2007, 05:48:13 am »

I switched to Java 6.

But so far, none of the Collada exemples have run through.
Are you interested that I dig a little bit into what kind of
collada constructs make it fails ?

Best regards,

Sebastien.

PS: It is Collada 1.4 or 1.4.1 that you are supporting ?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 01. October 2007, 11:16:40 am »

I switched to Java 6.

But so far, none of the Collada exemples have run through.
Are you interested that I dig a little bit into what kind of
collada constructs make it fails ?

Best regards,

Sebastien.

PS: It is Collada 1.4 or 1.4.1 that you are supporting ?

I am not the one, who develps the COLLADA loader. It's Amos and maguila. You should ass them. IIRC it's collada 1.4, but I don't really know. Of coulrs it's never wrong to dig into the code. Maybe you're even interested in helping them in development.

Marvin
Logged
'n ddrylliog
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #4 on: 01. October 2007, 06:14:33 pm »

So in short :
- Marvin, what's the problem with adding the missing jars even with the COLLADA loader not complete ?
- avedakadevra, a warm welcome to the Xith3D community. you should be able to use COLLADA. The schemas I have implemented are COLLADA 1.4.1 (the latest, as far as I know). Currently I'm looking into maguila's work (a contributor) about skeletal animation. But basic mesh loading is alright (triangles only, I'm afraid : though if you've got a good triangulation routine, why not).
Logged
avedakadevra
Just dropped in

Offline Offline

Posts: 5


View Profile
« Reply #5 on: 02. October 2007, 06:36:21 pm »

Thancks for the inputs.

I will look into what gets in and not. Collada is after all not so obvious
(there are subtilities in 1.4.1 which make a 1.4.1 not compatible with what
 was available before. I don't have the mail handy, but depending on the exporter/tool/
 exact version it is easy to get different coding styles for textures essentially).

I'll post if I have specific discoveries. I am only on basic mesh loading only. And I
 thinck it fair to force triangulation in the tool prior to export ...

Best regards,

Sebastien.
Logged
'n ddrylliog
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #6 on: 03. October 2007, 11:40:51 am »

Hmm basic mesh loading only ? Then it should be perfectly working. As for textures, I think the code is generic enough : it should need only little tweaking for other exporter/tools.
Logged
avedakadevra
Just dropped in

Offline Offline

Posts: 5


View Profile
« Reply #7 on: 05. October 2007, 06:41:56 am »

Hello Amos,

I have a DAE that comes from Feeling exporter for 3DS Max (3.0.2)
It contains a syntax not understood by the parser:

In the collada effect setion there is the following:

Code:
  <library_effects>
    <effect id="_1_-_Default-fx" name="_1_-_Default">
      <profile_COMMON>
        <newparam sid="C__Documents_and_Settings_seb_Mes_documents_Mes_images_Divers_Divers_IMG_0001_JPG-surface">
          <surface type="2D">
            <init_from>C__Documents_and_Settings_seb_Mes_documents_Mes_images_Divers_Divers_IMG_0001_JPG</init_from>
            <format>A8R8G8B8</format>
          </surface>
        </newparam>
        <newparam sid="C__Documents_and_Settings_seb_Mes_documents_Mes_images_Divers_Divers_IMG_0001_JPG-sampler">
          <sampler2D>
            <source>C__Documents_and_Settings_seb_Mes_documents_Mes_images_Divers_Divers_IMG_0001_JPG-surface</source>
            <minfilter>LINEAR_MIPMAP_LINEAR</minfilter>
            <magfilter>LINEAR</magfilter>
          </sampler2D>
        </newparam>

The parser crash at:

org.jibx.runtime.JiBXException: Expected "{http://www.collada.org/2005/11/COLLADASchema}sampler2D" end tag, found "{http://www.collada.org/2005/11/COLLADASchema}magfilter" start tag (line 37, col 24)

=> line 37 in that case correspond to the sampler2D in the extract above.

It seems the Schema might be incorrect. From the doc on Collada it looks correct.
(by the way, Blender importer can read it, but for some reason the image is lost even though the material shows the appropriate reference to it ...).

Best regards,

Sebastien.
Logged
'n ddrylliog
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #8 on: 10. October 2007, 05:03:08 pm »

Thanks for the report, I'll look into it (I'm currently fighting to take back possession of the COLLADA code Cheesy just refreshing my memory).
Logged
'n ddrylliog
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #9 on: 10. October 2007, 05:03:32 pm »

Though the complete file would be great to have to debug, if you can afford it (you can send it via PM).
Logged
avedakadevra
Just dropped in

Offline Offline

Posts: 5


View Profile
« Reply #10 on: 11. October 2007, 07:13:42 pm »

I just send the file through your mail icon.

Thancks for the effort,

Best regards,

Sebastien.
Logged
Andre Pohlmann
Enjoying the stay
*
Offline Offline

Posts: 89


View Profile Email
« Reply #11 on: 11. October 2007, 09:04:13 pm »

If the Collada-Loader is still broken, what is the recommanded loader at the moment ?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #12 on: 11. October 2007, 09:05:55 pm »

If the Collada-Loader is still broken, what is the recommanded loader at the moment ?

Well, it depends. If you don't need animations, you should use the OBJLoader. If you need animations, you could try the new MD5Loader. Don't know, if the Blender exporter is really working. Otherwise the Cal3DLoader seems to work pretty good.

Marvin
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic