simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene);
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.getViewingPlatform().setNominalViewingTransform();
simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene);
universe.getViewingPlatform().setNominalViewingTransform();
universe.getViewingPlatform().setNominalViewingTransform();
public Panel createPanel() { Panel p = new Panel(); p.setPreferredSize(new Dimension(512, 512)); p.setLayout(new BorderLayout()); Canvas3D canvas3D = new Canvas3D( SimpleUniverse.getPreferredConfiguration()); p.add("Center", canvas3D); BranchGroup scene = createSceneGraph(); scene.compile(); SimpleUniverse simpleU = new SimpleUniverse(canvas3D); simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene); return p; } // end of HelloJava3Dd (constructor)
simpleU.getViewingPlatform().setNominalViewingTransform();
/** * Called once IO is complete, attaches all the branchgroups to the locales */ public void buildGraph() { Locale locale; Enumeration<Locale> e = universe.getAllLocales(); for( int i=0; i<localeBGs.size(); i++) { locale = e.nextElement(); int[] bgs = (int[])localeBGs.get(i); for(int j=0; j<bgs.length; j++) { SymbolTableData symbol = control.getSymbolTable().getBranchGraphRoot( bgs[j] ); locale.addBranchGraph((BranchGroup)symbol.j3dNode ); } } if (viewerAvatar!=null) { viewerAvatar.buildGraph(); universe.getViewer().setAvatar( (ViewerAvatar)viewerAvatar.getNode()); } if (platformGeom!=null) { universe.getViewingPlatform().setPlatformGeometry( (PlatformGeometry)platformGeom.getNode() ); platformGeom.buildGraph(); } }
universe.getViewingPlatform().getViewPlatformTransform().setTransform(move); universe.addBranchGraph(content);
public void writeObject( DataOutput out ) throws IOException { MultiTransformGroup mtg = universe.getViewingPlatform().getMultiTransformGroup(); int mtgSize = mtg.getNumTransforms(); out.writeInt( mtgSize ); // Store the matrix from each MTG transform Transform3D trans = new Transform3D(); Matrix4d matrix = new Matrix4d(); for(int i=0; i<mtgSize; i++) { TransformGroup tg = mtg.getTransformGroup( i ); tg.getTransform( trans ); trans.get( matrix ); control.writeMatrix4d( out, matrix ); } control.writeObject( out, control.createState( universe.getViewingPlatform().getPlatformGeometry() )); control.writeObject( out, control.createState( universe.getViewer().getAvatar() )); writeLocales( out ); }
u.getViewingPlatform().setNominalViewingTransform();
public void readObject( DataInput in, Canvas3D canvas ) throws IOException { int mtgSize = in.readInt(); // MultiTransformGroup size if ( canvas!=null) { universe = new ConfiguredUniverse( canvas, mtgSize); } else { universe = new ConfiguredUniverse( ConfiguredUniverse.getConfigURL(), mtgSize); } MultiTransformGroup mtg = universe.getViewingPlatform().getMultiTransformGroup(); // Read and set the matrix for each MTG transfrom Matrix4d matrix = new Matrix4d(); for(int i=0; i<mtgSize; i++) { TransformGroup tg = mtg.getTransformGroup( i ); matrix = control.readMatrix4d( in ); Transform3D trans = new Transform3D( matrix ); tg.setTransform( trans ); } SceneGraphObjectState tmp = control.readObject(in); if (tmp instanceof PlatformGeometryState) platformGeom = (PlatformGeometryState)tmp; else platformGeom = null; tmp = control.readObject(in); if (tmp instanceof ViewerAvatarState) viewerAvatar = (ViewerAvatarState)tmp; else viewerAvatar = null; readLocales( in ); }
t1.rotX(Math.toRadians(-30)); viewPlatformTransform.mul(t1, t0); simpleUniverse.getViewingPlatform(). getViewPlatformTransform().setTransform(viewPlatformTransform);;
public Test() { SimpleUniverse universe = new SimpleUniverse(); BranchGroup group = new BranchGroup(); TransformGroup rootTransformGroup = new TransformGroup(); group.addChild(rootTransformGroup); rootTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); rootTransformGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); ColorCube colorCube = new ColorCube(.3); rootTransformGroup.addChild(colorCube); BoundingSphere boundingSphere = new BoundingSphere(new Point3d(0, 0, 0), 1000); MouseRotate mouseRotate = new MouseRotate(); mouseRotate.setTransformGroup(rootTransformGroup); mouseRotate.setSchedulingBounds(boundingSphere); group.addChild(mouseRotate); MouseTranslate mouseTrans = new MouseTranslate(); mouseTrans.setTransformGroup(rootTransformGroup); mouseTrans.setSchedulingBounds(boundingSphere); group.addChild(mouseTrans); universe.getViewingPlatform().setNominalViewingTransform(); universe.addBranchGraph(group); }
t0.mul(t1); simpleUniverse. getViewingPlatform(). getViewPlatformTransform(). setTransform(t0);
u.getViewingPlatform().setNominalViewingTransform();
BranchGroup group = new BranchGroup(); group.addChild(createModel()); universe.getViewingPlatform().setNominalViewingTransform(); universe.addBranchGraph(group);