Ah ok, so what I am doing should work then? Isnt getDocumentBase an
applet method call, what exactly does your urlBase look like? Thanks for
this by the way, much appreciated!

Ben 

>-----Original Message-----
>From: Franck Calzada [mailto:[EMAIL PROTECTED] 
>Sent: 30 April 2004 12:37
>To: [EMAIL PROTECTED]
>Subject: Re: [JAVA3D] Starfire loader and JAR files
>
>Yes, my 3DS files are located in a resource jar.
>I access it from either the applet or from my application 
>built package.
>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:32 PM
>                To: [EMAIL PROTECTED]
>                Subject: Re: [JAVA3D] Starfire loader and JAR files
>
>                Hm thanks for that - but are you actually 
>accessing the 3DS file from
>                within a JAR - I think this requires a 
>different approach - I have
>                managed it now with this technique, but this 
>is not really satisfactory
>                as it requires lots of changes to the existing code:
>
>                Loader3DS l = new Loader3DS();
>                l.noTextures();
>                l.setURLBase(tex);
>                try{
>                                Scene s = l.load(fileName);
>                                BranchGroup b = s.getSceneGroup();
>                                branchGroup.addChild(b);
>                        }
>                        catch(Exception e){}
>
>                thanks
>
>                >-----Original Message-----
>                >From: Franck Calzada 
>[mailto:[EMAIL PROTECTED]
>                >Sent: 30 April 2004 11:15
>                >To: [EMAIL PROTECTED]
>                >Subject: Re: [JAVA3D] Starfire loader and JAR files
>                >
>                >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".
>                >
>                >
>
>
>===============================================================
>============
>                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".
>
>

===========================================================================
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".

Reply via email to