Ahm okay. Anyway OBJ is only interesting for static objects (I use them for 3D menus) so that’s not where performance is really taking a hit.
Do you know where I could find the newest version of the loader? I checked the tk but that vers. still had the ModelLoader exception etc.
@kev - You’ve been extremely helpful!
Again, interestingly, OBJs are often used as keyframes - take the old Poser model format for instance. Also, I seem to remember Magicosm actually used raw OBJ keyframes with morphing between nodes - hmm, I think.
Kev
Yes indeed I know c_lilian use them that way with the Morph node… It’s an interesting way to go BUT :
- In the OBJ Blender exporter I can make it export one .OBJ file per frame which is fine but if my animation goes on 200 frames then I have 200 Obj files to mind with and I have to delete manually useless ones (those which are not keyframes, just transitional-frames).
- What’s the point of using OBJ keyframes vs MD2 models ? I heard MD2 was less precise due to values in bytes… Is it really important ?
You’d have to ask someone who has used OBJs as keyframes. I suspect its something to do with personal project workflow.
Kev
OBJ are quite different from MD2 ;
- MD2 are very imprecise, it is not important for RTS little characters, it is for bigger one (it waves a bit when they walk, …),
- MD2 do not provide satisfying normals in most case (just a rough look-up, you need to generate them),
- MD2 do not support indexed geometry which is not satisfying performance wise
- MD2 are limited to a single object with single texture
On the other side, using OBJ as morph target is not perfect either since you have a bit more informations to store outside of the .obj files ; animation name, object name used as keyframe, keyframes and lengths.
Collada gives all the needed feature for exchanging this type of animations. I hope that it will stop the neverending debate around file formats.
Vincent
Collada gives all the needed feature for exchanging this type of animations. I hope that it will stop the neverending debate around file formats.
I seriously doubt it
Kev
Well I don’t use MD2 for now because the Blender export script is crappy (“Error : check console”, it said… heh I’m not a python guy you know…).
I don’t use COLLADA for now because the Blender export script doesn’t support anims (and in fact doesn’t work at all on my computer).
So I’ll give OBJ a try… if it’s satisfactory maybe I’ll do something like a tool for bundling OBJ anims in a .JAR file with keyframes timestamps, anims names, textures and all that stuff. Could be pretty good as the Blender OBJ exporter is quite solid.
Still having problems with the exporter unfortunately. I’ve tried both removing the ModelLoaderException, and copying the old files into their place in the loader, nothing works: I still recieve the same errors as before.
Anyone know how to get around this?
You are just trying to compile the new MD2 code and it doesn’t work ?
Hmm I forgot to include this code for 0.8.0 but the next time I work on a release I’ll see what’s the problem.
(Hmm are you sure it’s the ModelLoaderException class ? I only see ModelLoadingException in the CVS…)
You’re right, it is ModelLoadingException. Typo :). I’m trying to simply use the loader to import a model. I had no problems with the last version of the loader.
Check my former post, you’ll see what error I’m getting.
Go in the source of the new MD2 Importer and change org.xith3d.loaders.md2.util.ModelLoadingException to org.xith3d.loaders.md2.newdawn.util.ModelLoadingException.
Packages have been renamed.
Thanks for the help! Still getting an error on compile though:
C:\xith3d\xith3d-0.7.1\xith3d>javac -classpath libs/xith3d.jar;C:\xith3d\third-p
arty\third-party\vecmath\vecmath.jar;C:\xith3d\third-party\third-party\jogl\jogl
.zip;c:/xith3d/md2loader2/xith-md2.jar -d classes HelloXith3D.java
HelloXith3D.java:90: cannot find symbol
symbol : class ModelLoadingException
location: class org.xith3d.gsg.HelloXith3D
catch (ModelLoadingException e) {/* Exception handling... */}
^
1 error
C:\xith3d\xith3d-0.7.1\xith3d>
Any ideas? Thanks!
You have to import the ModelLoadingException class if you want to use it. Otherwise just catch “Exception”.
But tell me is there any reason you don’t use an IDE ?
Do you know Eclipse ? (http://www.eclipse.org/)
I never got the time to download one. Will try to soon.
Ok - changed it to Exception and now here’s my error:
C:\xith3d\xith3d-0.7.1\xith3d>java -cp libs/xith3d.jar;C:\xith3d\third-party\thi
rd-party\vecmath\vecmath.jar;C:\xith3d\third-party\third-party\jogl\jogl.zip;cla
sses;c:/xith3d/md2loader2/xith-md2.jar org.xith3d.gsg.HelloXith3D
Exception in thread "main" java.lang.NoClassDefFoundError: org/xith3d/loaders/md
2/MD2Loader
Hehe classpath error : you used slashes “/” instead of back-slashes “” in your command for the md2 loader jar.
Do :
C:\xith3d\xith3d-0.7.1\xith3d>java -cp libs/xith3d.jar;C:\xith3d\third-party\thi
rd-party\vecmath\vecmath.jar;C:\xith3d\third-party\third-party\jogl\jogl.zip;cla
sses;C:\xith3d\md2loader2\xith-md2.jar org.xith3d.gsg.HelloXith3D
Apparently doesn’t matter whether you use forward or backward:
C:\xith3d\xith3d-0.7.1\xith3d>java -cp libs/xith3d.jar;C:\xith3d\third-party\thi
rd-party\vecmath\vecmath.jar;C:\xith3d\third-party\third-party\jogl\jogl.zip;cla
sses;c:\xith3d\md2loader2\xith-md2.jar org.xith3d.gsg.HelloXith3D
Exception in thread "main" java.lang.NoClassDefFoundError: org/xith3d/loaders/md
2/MD2Loader
Has org.xith3d.loader.md2.MD2Loader likewise moved to org.xith3d.loader.md2.newdawn.MD2Loader?
Kev
Has org.xith3d.loader.md2.MD2Loader likewise moved to org.xith3d.loader.md2.newdawn.MD2Loader?
Kev
Yes indeed.
(Note : you forgot the “s” at the end of “loaders”)