Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

11991 Posts in 1587 Topics- by 3508 Members - Latest Member: PienueDut

26. May 2012, 07:48:07 am
Xith3D CommunityGeneral CategorySupport (Moderator: Marvin Fröhlich)Quake 3 BSP map loading
Pages: [1]
Print
Author Topic: Quake 3 BSP map loading  (Read 2319 times)
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« on: 29. July 2008, 10:13:44 pm »

Hi everyone,

first let me congratulate you for the amazing work done on xith3d, it is very impressive.

I am trying to load an official Quake 3 BSP map (q3dm13.bsp). i first used the 0.9.6 beta 1 build available on the website ; it worked fine except for the TGA textures which Java tried to load as WBMP file :
Quote
java.lang.IllegalArgumentException: Empty region!
   at javax.imageio.ImageReader.computeRegions(Unknown Source)
   at com.sun.imageio.plugins.wbmp.WBMPImageReader.read(Unknown Source)
   at javax.imageio.ImageIO.read(Unknown Source)
   at javax.imageio.ImageIO.read(Unknown Source)
   at org.xith3d.loaders.texture.TextureLoader.loadFromStream(TextureLoader.java:411)
   at org.xith3d.loaders.texture.TextureLoader.loadFromStream(TextureLoader.java:562)
   at org.xith3d.loaders.texture.TextureLoader.getTexture(TextureLoader.java:682)
   at org.xith3d.loaders.texture.TextureLoader.getTexture(TextureLoader.java:805)
   at org.xith3d.loaders.models.impl.bsp.BSPConverter.convertTextures(BSPConverter.java:401)
   at org.xith3d.loaders.models.impl.bsp.BSPConverter.convert(BSPConverter.java:490)
   at org.xith3d.loaders.models.impl.bsp.BSPLoader.loadScene(BSPLoader.java:169)
   at org.xith3d.loaders.models.impl.bsp.BSPLoader.loadScene(BSPLoader.java:205)
   at auberge_emu.a.a(Unknown Source)
   at auberge_emu.a.<init>(Unknown Source)
   at auberge_emu.MainApplet.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

You can see the applet showing this exception in the console for each TGA texture here (JPG textures are loading ok) : http://agrv.free.fr/auberge_emu_xith

So I fetched the latest svn, adapted my code to the new InputSystem and tried it again. This time, the map will not display, instead I get an "/ by zero" exception :

Quote
java.lang.ArithmeticException: / by zero
   at org.xith3d.loaders.models.util.conversion.XithGeometryFactory.setTexCoord(XithGeometryFactory.java:144)
   at org.jagatoo.loaders.models.bsp.BSPVersionDataLoader46.convertFaceToSurfacePatch(BSPVersionDataLoader46.java:161)
   at org.jagatoo.loaders.models.bsp.BSPVersionDataLoader46.convertFacesToGeometries(BSPVersionDataLoader46.java:222)
   at org.jagatoo.loaders.models.bsp.BSPPrototypeLoader.load(BSPPrototypeLoader.java:1173)
   at org.jagatoo.loaders.models.bsp.BSPPrototypeLoader.load(BSPPrototypeLoader.java:1190)
   at org.xith3d.loaders.models.impl.bsp.BSPLoader.loadScene(BSPLoader.java:214)
   at org.xith3d.loaders.models.impl.bsp.BSPLoader.loadScene(BSPLoader.java:248)
   at auberge_emu.a.a(Unknown Source)
   at auberge_emu.a.<init>(Unknown Source)
   at auberge_emu.MainApplet.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

You can see the applet with this version here (exception showing in the console) :
http://agrv.free.fr/auberge_emu_xithsvn

Could you please help me on this matter ?
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #1 on: 29. July 2008, 11:56:35 pm »

Could you possibly send me this .bsp file?

Marvin
Logged
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« Reply #2 on: 30. July 2008, 05:13:56 am »

It is in the http://agrv.free.fr/auberge_emu_xith/auberge_emu-data.jar file, along with all the textures.
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #3 on: 30. July 2008, 06:56:08 pm »

I have fixed those bugs. Please update from SVN.

btw. Do you have a parser/loader for the Q3 shader files? If you do, would you mind sharing the code? And do you handle the map's billboards in some way?

Marvin
« Last Edit: 30. July 2008, 07:08:39 pm by Marvin Fröhlich » Logged
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« Reply #4 on: 30. July 2008, 08:44:10 pm »

I cannot test the fix because the svn trunk does not compile ; it seems that the jagatoo.jar is missing some classes in the org.jagatoo.loaders.models._util package. Or maybe I am missing something...

EDIT : ok, I managed to build a jagatoo.jar archive from the jagatoo svn to build the xith3d.jar and test my app, now the bsp file is loading without error. The TGA textures are also displayed.

For the billboards and the shaders, that's the point where I stopped my own bsp loader and tried the one in xith3d ; but I am willing to check this out and of course will share the code if i come up with something interesting.

Anyway, thanks for this quick fix and don't forget to update the jagatoo.jar in the xith3d svn.
« Last Edit: 31. July 2008, 05:24:03 am by Agrv » Logged
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« Reply #5 on: 05. November 2008, 07:05:23 am »

Hi, I had to suspend my xith3d project for a few weeks and tried to run it with the latest SVN this morning. I am getting a new NullPointerException while loading the BSP file :

Code:
java.lang.NullPointerException
at org.jagatoo.loaders.models.bsp.BSPConverter.convertFacesToShapes(BSPConverter.java:290)
at org.jagatoo.loaders.models.bsp.BSPConverter.convert(BSPConverter.java:424)
at org.jagatoo.loaders.models.bsp.BSPPrototypeLoader.load(BSPPrototypeLoader.java:1253)
at org.jagatoo.loaders.models.bsp.BSPPrototypeLoader.load(BSPPrototypeLoader.java:1271)
at org.xith3d.loaders.models.ModelLoader.loadModel(ModelLoader.java:504)
at org.xith3d.loaders.models.ModelLoader.loadModel(ModelLoader.java:563)
at org.xith3d.loaders.models.ModelLoader.loadModel(ModelLoader.java:589)
at org.xith3d.loaders.models.ModelLoader.loadModel(ModelLoader.java:744)
at org.xith3d.loaders.models.ModelLoader.loadModel(ModelLoader.java:761)
at org.xith3d.test.loaders.BSPLoaderTest.loadLevel(BSPLoaderTest.java:319)
at org.xith3d.test.loaders.BSPLoaderTest.createSceneGraph(BSPLoaderTest.java:400)
at org.xith3d.test.loaders.BSPLoaderTest.<init>(BSPLoaderTest.java:466)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.xith3d.test.Xith3DTestLauncher.runTest(Xith3DTestLauncher.java:854)
at org.xith3d.test.Xith3DTestLauncher$1.run(Xith3DTestLauncher.java:208)

This happens also in the BSP loader test from the xith-tk SVN (just replace the resource at line 318 from BSPLoaderTest.java with "quake3/q3dm13/q3dm13.bsp", the files are still in the repository). Thanks for your help !
Logged
Marvin Fröhlich
Xith Lord
Administrator
Guru
*****
Offline Offline

Posts: 4381


May the 4th, be with you...


View Profile
« Reply #6 on: 05. November 2008, 08:48:51 pm »

Fixed.

Marvin
Logged
Agrv
Administrator
Enjoying the stay
*****
Offline Offline

Posts: 64


View Profile
« Reply #7 on: 05. November 2008, 09:57:53 pm »

Great, thanks !
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic