[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[x3d-public] unload x3d file to load another with SAI
- To: x3d public mailing list <x3d-public@web3d.org>
- Subject: [x3d-public] unload x3d file to load another with SAI
- From: Nuno Martins <martins.01@gmail.com>
- Date: Sat, 3 Sep 2005 01:00:05 +0100
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ZwMfDKJptAODepotqXMZSoV8/BcqiHxNymHT2fqMRBANBQF8mFuLdlpZ5Md5Z7fPCov3GEhnq2cOwoxRo7AcqfspYRM8xv3mHav9Qb5fk0gdYeFNk1zP2c/kxLueJjo0S9CSWWa3r8KQ1AsEEp6wCj5nLP0S8N8Cbfw/M/J+MTA=
- Reply-to: martins.01@gmail.com
- Sender: owner-x3d-public@web3d.org
Hi
I'm loading a x3d file in xj3d using SAI but, now I need to unload one
file to load another.
Must I unload the initial x3d file to load the other, or simply replace?
To load the first x3d I use the following code, to load the next file
I simply use the same code but with different URL, is this done
correctly? One world is loaded in top of the other…
I'm getting one bug that I think will not happen if the first world is
unloaded and next load the second world, but I don't know how to do
that.
Thanks
Nuno
setDefaultCloseOperation(EXIT_ON_CLOSE);
Container contentPane = getContentPane();
// Setup browser parameters
HashMap requestedParameters = new HashMap();
// Create an SAI component
X3DComponent x3dComp =
BrowserFactory.createX3DComponent(requestedParameters);
// Add the component to the UI
JComponent x3dPanel = (JComponent)x3dComp.getImplementation();
contentPane.add(x3dPanel, BorderLayout.CENTER);
// Get an external browser
ExternalBrowser x3dBrowser = x3dComp.getBrowser();
setSize(800,700);
show();
// Create an X3D scene by loading a file
mainScene = x3dBrowser.createX3DFromURL(new String[] { "goblin.x3d" });
// Replace the current world with the new one
x3dBrowser.replaceWorld(mainScene);
-------------------------------------------------------------------------
for list subscription/unsubscription,
go to http://www.web3d.org/cgi-bin/public_list_signup/lwgate/listsavail.html