< Zurück | Inhalt | Weiter >

From AvatarTest.java (see also PlatformTest.java)

//Create a simple scene and attach it to the virtual universe SimpleUniverse u = new SimpleUniverse();

//Add everything to the scene graph—it will now be displayed. BranchGroup scene = sg.createSceneGraph(); u.addBranchGraph(scene);

PlatformGeometry pg = sg.createPlatformGeometry();

//set the just created PlatformGeometry. ViewingPlatform vp = u.getViewingPlatform(); vp.setPlatformGeometry(pg);


Viewer viewer = u.getViewer();

ViewerAvatar viewerAvatar = new ViewerAvatar(); viewerAvatar.addChild( sg.createViewerAvatar() );

viewer.setAvatar( viewerAvatar );