Java Can someone look at this Java code for me?

  • Thread starter Thread starter the other guy
  • Start date Start date
  • Tags Tags
    Code Java
AI Thread Summary
The discussion revolves around a user seeking assistance with Java code intended to load a MilkShape 3D model using Java 3D. The user mentions that the code is not compiling and has added an "ending parsing" line, which is unclear to others in the thread. Participants are trying to clarify the user's issues, questioning whether they are facing compile-time or run-time errors. There's confusion about the terminology used, particularly regarding "ending parsing," which is interpreted as a closing curly bracket. The lack of a main method in the code is also suggested as a potential issue. Overall, the conversation highlights the need for clearer communication about specific problems to facilitate effective troubleshooting.
the other guy
Messages
19
Reaction score
0
im starting a project from an Ebook that seems to be missing a line or two or something. Can someone suggest what should be here? I added the ending parsing since it was one of the more obvious missing things.


import com.sun.j3d.loaders.*;
import com.glyphein.j3d.loaders.milkshape.MS3DLoader;
import com.sun.j3d.utils.geometry.*;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import javax.media.j3d.BranchGroup;
import com.sun.j3d.loaders.objectfile.ObjectFile;
import com.sun.j3d.loaders.ParsingErrorException;
import com.sun.j3d.loaders.IncorrectFormatException;
import com.sun.j3d.loaders.Scene;
import java.applet.Applet;
import java.io.*;

class bob extends Applet {
// Loader loader = new MS3DLoader(MS3DLoader.LOAD_ALL);

private String filename = null;

public BranchGroup createSceneGraph() {
// Create the root of the branch graph
BranchGroup objRoot = new BranchGroup();

Loader raptor = new MS3DLoader(MS3DLoader.LOAD_ALL);
Scene s = null;
try {
s = raptor.load("Ships/raptor.MS3D");
}
catch (FileNotFoundException e) {
System.err.println(e);
System.exit(1);
}
catch (ParsingErrorException e) {
System.err.println(e);
System.exit(1);
}
catch (IncorrectFormatException e) {
System.err.println(e);
System.exit(1);
}

objRoot.addChild(s.getSceneGroup());
}

}
 
Technology news on Phys.org
OK, I looked at it...

Without actually formatting it so I can grok the braces, it looks like it oughta compile.

What's it 'sposed to do, and what isn't it doing? Also not sure what the "ending parsing" you added is or why?
 
schip666! said:
OK, I looked at it...

Without actually formatting it so I can grok the braces, it looks like it oughta compile.

What's it 'sposed to do, and what isn't it doing? Also not sure what the "ending parsing" you added is or why?

It's supposed to load a milkshape3d model. I know i didnt put in a universe or anything standard like that yet (trying to keep posted code simple), but for some reason, I can't get the all clear from my editor for the code.

There was origionally one parsing at the end, but I added another to close it off.
 
schip666! said:
What's it 'sposed to do, and what isn't it doing? Also not sure what the "ending parsing" you added is or why?

I don't get the "ending parsing" bit, either. What "parsing" bit are you talking about?

To expand on schip666!'s questions, what problems are you having? Are you getting compiler errors or run-time errors or what?
 
Mark44 said:
I don't get the "ending parsing" bit, either. What "parsing" bit are you talking about?

To expand on schip666!'s questions, what problems are you having? Are you getting compiler errors or run-time errors or what?


Sorry. Forget the Parsing thing.

I'm trying to get a model to import and run in JAVA3D. a model from milkshape3d
 
Again, what problems are you having? Are you getting compiler errors or run-time errors or what? If you don't give us some idea of where you're stuck it's very difficult to provide any help.
 
This is a good example of a curious phenomenon in these sorts of "help" forums...
There is obviously some kind of problem, but the poster doesn't seem to have enough experience -- yet -- to know what to specify, or how to capture the output, in order to get help.

Phrases like "added ending parsing" and "getting the all-clear from my editor" make wonderful sense -- to the poster -- but only open further cans'o'worms for the rest of us riff-raff. Providing the missing context and actual errors is what we need here, e.g.,
by "all-clear from my editor" I'm suspecting that "editor" means the development system
and that there's a compile time error of some sort. But without having exactly the same, unspecified, system, we are somewhat en-darkened...
 
By "ending parsing" the original poster means the closing curly bracket "}".

Not sure what's wrong with the code. Maybe the lack of main()?
 
Back
Top