PDA

View Full Version : Importing .OBJs into Java 3D


mjkennedy
01-10-2008, 06:17 PM
Hi,

First off, not sure if this is the right forum to post this question in, but there's no forum devoted specifically to my problem, so please bare with me.

I am trying to import OBJ's into Java 3D. Sometimes they import, but with weird graphical artifacts, and sometimes they wont load at all. I get a "error in line: X (it's a random line depending on the file).

Now, I might have thought that perhaps it was the files themselves. But I tried building and exporting a model from both XSI, and Blender, and files from both programs produced the same errors. So, that leads me to believe that perhaps there's a probelm with Java, as I can't see files from both programs producing the same error.

If anyone has any knowledge in this area, and could lend a hand, it would be greatly appreciated.

Thanks,

Matt

Kuroyume0161
01-10-2008, 08:07 PM
I'd consult the Java 3D docs concerning Wavefront .obj files. It could be that splines (denoted as 'line' in the file) are not supported. It could be that J3D only supports triangular and/or quadrangular polygons (facets 'f'). That is, it may not support n-gons or even quadrangles which will require triangulation sometime prior to use with J3D. There are some other possibilities here - line endings, line continuation using '\', multiple group names ('g'), use of extended characters for names (UNICODE et al).

If nothing in the docs, go to the source and search/ask:
http://forum.java.sun.com/forum.jspa?forumID=21

CGTalk Moderation
01-10-2008, 08:07 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.