WaveFront .obj file loader in Java applet

View: New views
4 Messages — Rating Filter:   Alert me  

WaveFront .obj file loader in Java applet

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

It's quite easy to create a WaveFront object file loader in Java, and it works fine when we run the code as an application.
But when I try to run it as an applet it just shows an empty window and closes.

What is the problem? Is it the Java's 'sandbox' limitation so the applet can't read external .obj file? How it could be solved?

I appreciate for any help,

lambe
[Message sent by forum member 'lambee' (lambee)]

http://forums.java.net/jive/thread.jspa?messageID=275476

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: WaveFront .obj file loader in Java applet

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>It's quite easy to create a WaveFront object file loader in Java

Yes, James Gosling himself wrote one for WireFrame applet demo  -  check your JDK/demo/applets/Wireframe folder  .
And Java3D also has a OBJ loader - see example ObjLoader.

If you put your model in a jar file, you can load it from an applet by using  something like :
[code]
URL  url = MyApplet.class.getResource("myModel.obj");
//or
InputStrean in = MyApplet.class.getResourceAsStream("myModel.obj")
[/code]

There are other ways, tought.
[Message sent by forum member 'zesharp' (zesharp)]

http://forums.java.net/jive/thread.jspa?messageID=275484

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: WaveFront .obj file loader in Java applet

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
Thanks for your advice. I'll try :)

lambe
[Message sent by forum member 'lambee' (lambee)]

http://forums.java.net/jive/thread.jspa?messageID=277045

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...


Re: WaveFront .obj file loader in Java applet

by java3d-interest :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello again,

I did as you adviced and it works perfectly :))
Here is the lines I used:

URL File = this.getClass().getResource("filename.obj");
                scene = file.load (File);

But there is strange problem...
The applet always works on a local machine. When it is put on a web server on some machines the applet works as well, but on others it doesn't, and the Java console returns exception: "com.sun.j3d.loaders.ParsingErrorException: IO error on line 2082: ZipFile closed".

Could anyone help with this problem?

lambe
[Message sent by forum member 'lambee' (lambee)]

http://forums.java.net/jive/thread.jspa?messageID=280988

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@...
For additional commands, e-mail: interest-help@...