3D loaders - 2 questions

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

3D loaders - 2 questions

andrewk1972
Java3D specifies a Loader interface that can be implemented for any particular file format.
It also has a couple of builtin loaders for OBJ and LWO.

1. The built-in OBJ loader is pretty crappy and limited. I attempted to load 3 different models but only one loaded and displayed...the others generated an exception, eg.
org.jogamp.java3d.loaders.ParsingErrorException: Unrecognized token, line 4

Doesn't say what the token is...nor how to skip it...

2. Does anyone know of other loaders that actually work? Especially for 3DS, OBJ, COB files...?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: 3D loaders - 2 questions

gouessej
Administrator
Hello

Please can you try to load the faulty models with MeshLab or Blender? It would be nice if you could give us some URLs pointing to those files or if you could upload them somewhere.

Do your COB files come from Caligari TrueSpace?

When I have the necessary pieces of information, I'll be able to try to load your models with the most reliable loaders I know and maybe I'll create some sort of bridge to make them work with Java3D >= 1.7 (more future proof, I won't waste time with Java3D 1.6).

Of course, if I find a quick fix for the build-in Java3D loader you use, I'll provide a patch to Phil and he'll review it.

By the way, please post the full stack trace.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: 3D loaders - 2 questions

andrewk1972
All the OBJ models I have can be imported and displayed in Blender.

A handful will load and display using the built-in OBJ loader.
Most raise the exception:
org.jogamp.java3d.loaders.ParsingErrorException: Unrecognized token, line <x>

No other stack trace, so it appears the program terminates gracefully.

This one works:
https://free3d.com/3d-model/sh-60-seahawk-32184.html
This one doesn't:
https://free3d.com/3d-model/16g-motor-grader-20584.html

If you want to check how well the built in OBJ loader, download some free models at:
https://free3d.com/3d-models/
There are lots of them!

Thanks for looking into this!

You asked: "Do your COB files come from Caligari TrueSpace?"
No idea. Got them from the web...



Reply | Threaded
Open this post in threaded view
|

Re: 3D loaders - 2 questions

gouessej
Administrator
I get an HTTP error 504 when trying to download the first model.

Have you tried to load the second OBJ file after removing the 6 lines of comments?

Actually, there are several formats called COB.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: 3D loaders - 2 questions

andrewk1972
I got same error. Then I tried again, and it worked.
Try again.

In any case, there are stacks of models there to try...
https://free3d.com/3d-models/
Reply | Threaded
Open this post in threaded view
|

Re: 3D loaders - 2 questions

gouessej
Administrator
Please can you rename the MTL file and its mention in the OBJ file so that its name doesn't contain any space?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: 3D loaders - 2 questions

andrewk1972
Tried that and it didn't make any difference...

Then I realised the "unrecognised token" error in the exception is the offending line in the OBJ file...
It appears the "unrecognised token" is the "o" at the beginning of the line.
So I commented out the line beginning with "o" and hey presto...
The model displays!

Note that I don't think the MTL file is being used. Indeed most of the models have no MTL file...