Problem importing 3ds files into applet

Started by Tornado7, April 29, 2004, 12:02:17 PM

Previous topic - Next topic

Tornado7

Hi all,

I'm using jPCT to create an University 3d simulation for medical porpouse; I've created a world using Maya and I've converted the Maya's file into a 3DS file using FBX Converter.
When I load the 3DS file using an stand-alone application, such as FPS, the file is loaded without any problem; Problems occur when I try to load the 3DS scene in a applet, such as Bounce; in fact the Sun Java Console shows the following message:

[ Thu Apr 29 11:20:24 CEST 2004 ] - ERROR: Couldn't read file 3ds\prova.3ds
[ Thu Apr 29 11:20:24 CEST 2004 ] - ERROR: Not a valid 3DS file!
Created 0 triangle-strips for object2 in 1 pass(es)
[ Thu Apr 29 11:20:24 CEST 2004 ] - ERROR: Couldn't build() object! Check if the object is assigned to a world and if the TextureManager has all required textures loaded.

Do you have any explaination about this behaviour? Is it possible that 3DS files don't fit in a web application? If it's so, what other file format should I try? Thanks for any help  :)

EgonOlsen

3DS is fine for applets. You just have to take care that you are using the appropriate method to load it. The Loader-class offers three variants for each kind of model. One is for applications, one for applets (the one with the document base) and one for input streams. For an applet, you may use the applet  version (the document base can be obtained from the applet by calling this.getDocumentBase()) or you include your model into a JAR and load it using an input stream (this.getClass ().getResourceAsStream("....") or similar). That will work with applications, applets and webstartable application, so it may be the better choice in the long run.
BTW: Don't use "\" as a separator in your path but "/" when loading from within your applet.

Hope this helps.

Anonymous

All right, I solved my problem..... Thanks  :D