Skip to main content

Loader Issues: Specifically VRML

6 replies [Last post]
tpittman
Offline
Joined: 2004-08-12
Points: 0

Hello Board,

I am looking to load a 3D model of an airplane. The original is in IV format, but I was looking into using the TGS 3SpaceAssistant (www.tgs.com) to convert the files to VRML. During a trial period on their I attempted to load the converted VRML files into Java3D using the three loaders listed on the J3D site (http://www.j3d.org/utilities/loaders.html). None of them worked for me, each with different problems. Has anyone used the 3SpaceAsistant program before/know if its worth its salt? Is there a better file conversion tool (free or pay)?

Is there a good reason that both the CyberX3D and J3D-VRML97 loaders do not follow the interface laid out by Java? Their code makes it difficult to swap out loaders easily, and very difficult to get the model back from the loader.

The Xj3D preview loader would not accept my model at all, so I did not attempt to integrate it into my code.

Overall I am very frustrated with this all. I started looking into different file formats and loaders to go with them. The Lightwave loader included in the J3D code failed to load several models I passed it, both .lwo and .lws files. I had some success with the 3DS loader by Aaron Mulder (http://www.j3d.org/utilities/loaders/3ds/mulder.html), however it still failed on some models.

I am willing to look into a variety of file formats, but need a reliable loader. The models I am loading are simple, purely geometry: I can add lights in J3D, and there will be no animation or complex things like fog or shadows.

Any advice on this subject would be much appreciated.

TPittman

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Justin Couch

The question is which VRML format did it convert to? If you're coming from
IV, then it's most likely to have converted to VRML 1.0, which no loaders
support that I'm aware of. WHat error messages did the various loaders
issue?

Justin
(pine enabled on the road in the USA somewhere)

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

tpittman
Offline
Joined: 2004-08-12
Points: 0

Hello,

The 3SpaceAssistant allowed conversion to VRML 2.0 (VRML97).

The Xj3D demo browser fails to load the file with an error of:
Unexpected Exception:
3
java.lang.ArrayIndexOutOfBoundsException: 3
at org.web3d.vrml.renderer.common.nodes.geom3d.BaseIndexedFaceSet.rebuildFaceLists(BaseIndexedFaceSet.java:1176)
...
...
at xj3d.browser.Xj3DBrowser.load(Xj3DBrowser.java:663)

I will put the other loaders back into my code, however the problem with the J3D-VRML97 loader was trying to interface with it. When you do a load it returns a Scene object written by them, and from there I can not easily pull off a SceneGroup according to instructions with the standard loader interface.

Give me a second on the CyberX3D to recreate the error, I will post in a minute.

Thanks for the fast response Justin ^_^.

Travis

Justin Couch

On Thu, 18 Nov 2004 java3d-interest@javadesktop.org wrote:

> The 3SpaceAssistant allowed conversion to VRML 2.0 (VRML97).

Ok. That makes things easier to track down :)

> The Xj3D demo browser fails to load the file with an error of:
> Unexpected Exception:
> 3
> java.lang.ArrayIndexOutOfBoundsException: 3
> at org.web3d.vrml.renderer.common.nodes.geom3d.BaseIndexedFaceSet.rebuildFaceLists(BaseIndexedFaceSet.java:1176)

That's an odd one as it's a blank line of code in my copy here. Would you
mind sending me a test file that's generating this error and I'll take a
look at it next week when I get back to the office. I have some paid time
to go through the IFS code right now to do some performance improvements,
so I'll debug it while in the area.

One possible problem with the other loaders is that the file conversion
may not have been perfect. That's something that we encounter reasonably
regularly, unfortunately. At least having a look at the test file will
reveal anything dodgy going on in that area too.

> however the problem with the J3D-VRML97 loader was trying to interface
> with it. When you do a load it returns a Scene object written by them,
> and from there I can not easily pull off a SceneGroup according to
> instructions with the standard loader interface.

Considering that it was one of the first loaders written by Sun to their
own interface, and I'm very familiar with the codebase (that's where Xj3D
descended from) then that seems quite an interesting statement. The
interface did correspond to the stock requirements of the Scene, which
allows access to the root node. What's changed then - or are you making
the invalid assumption that everything should return an instance of
SceneBase and not Scene?

> Give me a second on the CyberX3D to recreate the error, I will post in
a minute.

I'll be online for about another hour before heading off again. Won't be
back near a network connection until monday next week. Don't be surprised
if you get empty silence after the next reply :)

Justin
(pine enabled on the road somewhere in the USA)

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net

tpittman
Offline
Joined: 2004-08-12
Points: 0

Hello,

What does IFS stand for?

I am using the Xj3D demo browser that is created after installing the Xj3D code set. From there I am just attempting to open the VRML model, and then the error occurs.

On the J3D-VRML97 loader, I am looking at the API for the Loader class. Using the returned Scene object from the load() method, I thought you could then call getSceneGroup() on the Scene object. This is what I used for the Sun supported Lw3dLoader and the 3DS loader by Aaron Mulder. The J3D-VRML97 API does not say their Loader class implements the Loader interface.

I looked in the CyberX3D, their code does not follow the Java interfaces either. It seems their code is built around traversing the node structure till you find the specific nodes you want to grab off. I do now know enough about the file format attempt this.

I will be out of the office until early next week also, but will be looking for responses then. Good travels to you.

Cheers
Travis

tpittman
Offline
Joined: 2004-08-12
Points: 0

Hello Justin,

Any chance to look into this matter? I still have had no luck with the loaders.

Travis

Justin Couch

java3d-interest@javadesktop.org wrote:

> Hello Justin,
>
> Any chance to look into this matter? I still have had no luck with the loaders.

Sorry. Completely slipped my mind. We're in heads-down-bums-up mode
trying to get ready for I/ITSEC next week, thus my attention has been
heavily focussed trying to get some demos working.

--
Justin Couch http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler http://www.yumetech.com/
Author, Java 3D FAQ Maintainer http://www.j3d.org/
-------------------------------------------------------------------
Programming is essentially a markup language surrounding
mathematical formulae and thus, should not be patentable.
-------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@java3d.dev.java.net
For additional commands, e-mail: interest-help@java3d.dev.java.net