cs_tds
Messages postés351Date d'inscriptionmercredi 21 janvier 2004StatutMembreDernière intervention 9 décembre 2004
-
18 mars 2004 à 12:32
dmaillet
Messages postés500Date d'inscriptionmercredi 20 août 2003StatutMembreDernière intervention11 juillet 2007
-
11 mai 2005 à 10:46
Voilà, je ne parviens pas à bouger dans mon univers (VirtualUniverse). Je ne veux pas utiliser SimpleUniverse parce que certaines objects view... sont isLive == true et je ne peux donc pas changer des capabilities...
// User-specified canvas
private Canvas3D canvas;
// Scene graph elements to which the user may want access
private BranchGroup vpRoot = new BranchGroup();
private VirtualUniverse universe;
private Locale locale;
private TransformGroup vpTrans;
private View view;
this.canvas = c;
//Establish a virtual universe that has a single
// hi-res Locale
universe = new VirtualUniverse();
locale = new Locale(universe);
// Create a PhysicalBody and PhysicalEnvironment object
PhysicalBody body = new PhysicalBody();
PhysicalEnvironment environment = new PhysicalEnvironment();
view = new View();
view.addCanvas3D(c);
view.setPhysicalBody(body);
view.setPhysicalEnvironment(environment);
// Create a BranchGroup node for the view platform
BranchGroup vpRoot = new BranchGroup();
// Create a ViewPlatform object, and its associated
// TransformGroup object, and attach it to the root of the
// subgraph. Attach the view to the view platform.
Transform3D t = new Transform3D();
t.set(new Vector3f(0.0f, 0.0f, 2.0f));
ViewPlatform vp = new ViewPlatform();
vpTrans = new TransformGroup(t);
view.attachViewPlatform(vp);
vpTrans.addChild(vp);
vpRoot.addChild(vpTrans);
// Attach the branch graph to the universe, via the
// Locale. The scene graph is now live!
locale.addBranchGraph(vpRoot);
}
/***********************/
/* LES GET ET LES SETS */
/***********************/
public VirtualUniverse getVirtualUniverse(){ return universe; }
public Locale getLocale (){ return locale; }
public TransformGroup getTransformGroup (){ return vpTrans; }
public View getView (){ return view; }
public Canvas3D getCanvas3D (){ return canvas; }
public BranchGroup getBranchRoot (){ return vpRoot; }
}
VOICI SIMPLEUNIVERSE (DE JAVA)
***************************
///////////////////////////////////////////////////////////
// DeJaved by mDeJava v1.0. Copyright 1999 MoleSoftware. //
// To download last version of this software: //
// http://molesoftware.hypermatr.net //
// e-mail:molesoftware@mail.ru //
///////////////////////////////////////////////////////////
// JAD JavaDecompiler by Pavel Kuznetsov //
// www.geocities.com/SiliconValley/Bridge/8617/jad.html //
///////////////////////////////////////////////////////////
public ViewingPlatform getViewingPlatform()
{
return viewer[0].getViewingPlatform();
}
public Canvas3D getCanvas()
{
return getCanvas(0);
}
public Canvas3D getCanvas(int i)
{
return viewer[0].getCanvas3D(i);
}
public void addBranchGraph(BranchGroup branchgroup)
{
locale.addBranchGraph(branchgroup);
}
public static GraphicsConfiguration getPreferredConfiguration()
{
GraphicsConfigTemplate3D graphicsconfigtemplate3d = new GraphicsConfigTemplate3D();
String s = (String)AccessController.doPrivileged(new Object() /* anonymous class not found */
class _anm1 {}