Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Working with Loaders (DXF)

843799Jan 10 2003 — edited Feb 13 2003
Hey everyone,

I am new to Java 3D and I have been reading through the Java tutorial. I just got to the chapter about loaders (this stuff is really cool).

So anyway, I want to load DXF files. So I did a search and found a DXF loader at: http://www.ncsa.uiuc.edu/~srp/Java3D/portfolio/

After reading the API I was sure I could load up a DXF file, but something in my code is not working. I was just wondering if one of you could take a look at the code below and tell if there is anything blatantly wrong. I looked at a demo that came with Java 3D, and it seems like what I am doing is very similar, but I just can't get it to work. The comments in the code explain the problem:

//From NCSA package I downloaded at the website
ModelLoader loader = new ModelLoader();
Scene model1 = loader.load("basins.dxf");

//When I leave the below line in the code, it prints null
//model, so that is obviously the problem, but I have no idea
//why. I have the file in the same directory of this code.
//if(model1 == null) System.out.println("null model");

//And of course I get a NullPointerException here since model1
//is null
BranchGroup scene = model1.getSceneGroup();

Even in the API from NCSA for ModelLoader, it has a usage example. It is pasted below:

ModelLoader loader = new ModelLoader();
Scene model1 = loader.load(new URL("http:/havefun.ncsa.uiuc.edu/~srp/astro.wrl"));
Scene model2 = loader.load("cah.obj");
Scene model3 = loader.load("/opt/jw.dxf");

Looks exactly like what I am trying to do.

Anyway, perhaps this question is way to specific, and I'm not sure how many people have worked with the NCSA classes, but any help would be appreciated. If anyone has done DXF loaders and know of other libraries I can dowload and use, I would appreaciate that too.

thanks in advance,
Armand
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 13 2003
Added on Jan 10 2003
2 comments
235 views