Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11855 Posts in 1569 Topics- by 3054 Members - Latest Member: Ljustin770

11. February 2012, 12:41:19 PM
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Problems loading collada models
Pages: [1]
Print
Author Topic: Problems loading collada models  (Read 714 times)
gbrinon
Just dropped in

Offline Offline

Posts: 19



View Profile
« on: 01. March 2010, 05:48:26 PM »

Hi,
I've two problems trying to load collada models (i'm using the fantassin_cape.dae from xith-tk : SVN updated a month ago)

Here comes the code:
Code:
package main;

import java.io.IOException;

import org.xith3d.base.Xith3DEnvironment;
import org.xith3d.loaders.models.Model;
import org.xith3d.loaders.models.impl.dae.DaeLoader;
import org.xith3d.loaders.models.impl.dae.DaeModel;
import org.xith3d.loop.RenderLoop;
import org.xith3d.render.Canvas3D;
import org.xith3d.render.Canvas3DFactory;
import org.xith3d.render.config.OpenGLLayer;
import org.xith3d.scenegraph.BranchGroup;

public class TestScene extends RenderLoop
{

public Canvas3D canvas;
public Xith3DEnvironment env;

public TestScene()
{
super( 120f );
 
    this.env = new Xith3DEnvironment( this );
   
    this.canvas = Canvas3DFactory.createWindowed(OpenGLLayer.LWJGL, 640, 480, "TestScene");
    this.env.addCanvas( this.canvas );

    DaeLoader Mloader = new DaeLoader();
   
DaeModel mod = null;
try
{
mod = (DaeModel) Mloader.loadModel("fantassin_cape.dae");
}
catch (IOException e) {e.printStackTrace();}
catch (Exception e) {e.printStackTrace();}

//Model model1 = mod.getSharedInstance();
BranchGroup grp = new BranchGroup(mod);

env.addParallelBranch(grp);
   
    this.begin();
}

}
This little sample works but :


1st problem
If I replace :
Code:
this.canvas = Canvas3DFactory.createWindowed(OpenGLLayer.LWJGL, 640, 480, "TestScene");
by
Code:
this.canvas = Canvas3DFactory.createWindowed(640, 480, "TestScene");
(I guess it leaves to the engine the choice of the renderer)

It gives me :
Quote
guillaume@rincevent:~/Bureau/TAF/TEST$ ./testlauncher.sh
lib/libext/
do_wait: drmWaitVBlank returned -1, IRQs don't seem to be working correctly.
Try adjusting the vblank_mode configuration parameter.
java: tnl/t_draw.c:232: bind_inputs: Assertion `inputs->BufferObj->Pointer' failed.
Aborted

2nd Problem
If I replace :
Code:
//Model model1 = mod.getSharedInstance();
BranchGroup grp = new BranchGroup(mod);
by
Code:
Model model1 = mod.getSharedInstance();
BranchGroup grp = new BranchGroup(model1);
(Useful to display more than one time a single object)

I get :
Quote
guillaume@rincevent:~/Bureau/TAF/TEST$ ./testlauncher.sh
do_wait: drmWaitVBlank returned -1, IRQs don't seem to be working correctly.
Try adjusting the vblank_mode configuration parameter.
Exception in thread "main" java.lang.StackOverflowError
   at org.xith3d.loaders.models.impl.dae.DaeModel.getSharedInstance(DaeModel.java:109)
   at org.xith3d.loaders.models.impl.dae.DaeModel.getSharedInstance(DaeModel.java:109)
   at org.xith3d.loaders.models.impl.dae.DaeModel.getSharedInstance(DaeModel.java:109)
And it get in a infinite loop  Undecided

Is there a problem in my code ?

Maybe the launcher ?
Code:
#!/bin/sh

LIB=lib

#JAVA="java -agentlib:yjpagent"
JAVA=java

$JAVA -Djava.library.path=$LIB/libext/ -Xms64m -Xmx128m -classpath .:bin/:$LIB/gluegen-rt.jar:$LIB/jogl.jar:$LIB/lwjgl.jar:$LIB/joal.jar:$LIB/openmali.jar:$LIB/hial.jar:$LIB/jagatoo.jar:$LIB/joode.jar:$LIB/jops.jar:$LIB/xith3d.jar:$LIB/jinput.jar main/MainEntry

Thanks
« Last Edit: 01. March 2010, 05:53:01 PM by gbrinon » Logged

Guillaume
HEMERA project on XITH3D
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4337


May the 4th, be with you...


View Profile
« Reply #1 on: 01. March 2010, 11:30:22 PM »

I don't know about the IRQ thing. Are you using a Mac? The tend to have problems with JOGL when SWT is in the classpath.

I have added a missing super call in the DaeModel's getShaeredInstance() method. I couldn't test it now. But please gibe it is try.

Marvin
Logged
gbrinon
Just dropped in

Offline Offline

Posts: 19



View Profile
« Reply #2 on: 02. March 2010, 06:41:19 AM »

The proble was not really on the IRQ  (just seems to be a warning) but more on the
java: tnl/t_draw.c:232: bind_inputs: Assertion `inputs->BufferObj->Pointer' failed.
Aborted

In fact it's not a real problem since i prefer using LWJGL.

I tried your change. It seems to work. Thanks a lot
« Last Edit: 02. March 2010, 07:10:37 AM by gbrinon » Logged

Guillaume
HEMERA project on XITH3D
horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #3 on: 03. March 2010, 05:08:32 AM »

Are you using a Mac? The tend to have problems with JOGL when SWT is in the classpath.

In fact, it is nearly impossible to run several non-Xith applications if SWT is present in the classpath.  I am unable to run several Swing applications whenever SWT is present (usually because JFreeChart includes it).  In those cases, I am forced to track down the SWT inclusion to remove it.  It seems to be a problem with some mode detection code inside Apple's GUI library.
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic