I also use starfire in my applet (
http://membres.lycos.fr/franckcalzada/Billard3D/Pool.html
<http://membres.lycos.fr/franckcalzada/Billard3D/Pool.html> )
I have no problem loading 3DS files either in applet or application mode.
Here is my code:
TransformGroup theModel =
loadMyObjectURL("3ds/PoolTable.3ds");
public static TransformGroup loadMyObjectURL(String fileName) {
URL url = PoolUtil.getMyURL(fileName);
String urlBase = Pool.getDocumentBase().getPath();
Debug.log(
Debug.INFO,
PoolSceneGraph.class,
"loadMyObjectURL",
"url={0}, urlBase = {1}",
url,
urlBase);
Inspector3DS loader = new Inspector3DS(url); // constructor
loader.setURLBase(urlBase + "resources/3ds/");
loader.setTextureLightingOn(); // turns on texture modulate
mode
loader.setTexturePath(urlBase + "resources/3ds/");
// optional alternate path to find texture files
loader.parseIt(); // process the file
TransformGroup theModel = loader.getModel();
// get the resulting 3D model as a Transform Group with
Shape3Ds as children
return theModel;
}
public static URL getMyURL(String str) {
URL url = Pool.class.getClassLoader().getResource(str);
Debug.log(
Debug.INFO,
PoolUtil.class,
"getMyURL",
"filename={0}, url = {1}",
str, url);
if (isApplet) {
Debug.log(
Debug.INFO,
PoolUtil.class,
"getMyURL",
"applet method"
);
try {
url = new URL(getDocumentBase(), str);
} catch (MalformedURLException e) {
e.printStackTrace();
}
Debug.log(
Debug.INFO,
PoolUtil.class,
"getMyURL",
"filename={0}, url = {1}",
str, url);
}
return url;
}
Hope it will help you.
Regards
Franck
-----Original Message-----
From: Discussion list for Java 3D API
<[EMAIL PROTECTED]>@SUNGARD On Behalf Of Ben Logan
<[EMAIL PROTECTED]>
Sent: Friday, April 30, 2004 12:00 PM
To: [EMAIL PROTECTED]
Subject: [JAVA3D] Starfire loader and JAR files
Hi
I wonder if anyone could help me? I have been using the
starfire 3DS
loader for a while now and its great! The problem is with
deployment, I
cant seem to get it to load from a jar file. I know I have
the
directories etc correct, so I just need to know how to do
it? Code
snippet:
System.out.println("3DS FILE: " + fileName);
System.out.println("URL BASE: " + t);
Inspector3DS loaded3DS = new Inspector3DS(fileName);
loaded3DS.setURLBase(t);
Any help would be much appreciated!
Thanks
Ben
********************************************
Ben Logan - Graduate Software Engineer
RCID
Stephenson Building
Newcastle Upon Tyne
NE1 7RU
www.rcid.ncl.ac.uk
********************************************
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body
of the message "signoff JAVA3D-INTEREST". For general help,
send email to
[EMAIL PROTECTED] and include in the body of the message
"help".
Confidentiality Notice: This email and any files transmitted with it are
confidential and are intended solely for the use of the individual or entity
to whom they are addressed. If you are not the original recipient or the
person responsible for delivering the email to the intended recipient, be
advised that you have received this email in error, and that any use,
dissemination, forwarding, printing, or copying of this email is strictly
prohibited. If you received this email in error, please notify the
originator immediately.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".