BackgroundSound mBackgroundSound = new BackgroundSound();
scene.compile(); simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene); BranchGroup lineGroup = new BranchGroup(); Appearance app = new Appearance(); ColoringAttributes ca = new ColoringAttributes(new Color3f(204.0f, 204.0f,204.0f), ColoringAttributes.SHADE_FLAT); app.setColoringAttributes(ca); Point3f[] plaPts = new Point3f[5]; for (int i = 0; i < 2; i++) { pla.setCoordinates(0, plaPts); PointAttributes a_point_just_bigger=new PointAttributes(); a_point_just_bigger.setPointSize(10.0f);//10 pixel-wide point a_point_just_bigger.setPointAntialiasingEnable(true);//now points are sphere-like(not a cube) app.setPointAttributes(a_point_just_bigger); PolygonAttributes la=new PolygonAttributes(); la.setPolygonMode(PolygonAttributes.POLYGON_FILL); la.setCullFace(PolygonAttributes.CULL_NONE); app.setPolygonAttributes(la); Material matt=new Material(); matt.setAmbientColor(new Color3f(1,1,1)); matt.setDiffuseColor(new Color3f(0.5f,0.5f,0.7f)); matt.setEmissiveColor(new Color3f(0.2f,0.2f,0.3f)); matt.setShininess(0.5f); matt.setSpecularColor(new Color3f(0.4f,0.6f,0.9f)); matt.setLightingEnable(true);
scene.compile(); simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene); BranchGroup lineGroup = new BranchGroup(); Appearance app = new Appearance(); pts[23].x=0.5f;pts[23].y=0.5f;pts[23].z=-0.5f; normals[20].y=1;normals[21].y=1;normals[22].y=1;normals[23].y=1; lsa.setNormals(0, normals); lsa.setCoordinates(0, pts); Shape3D sh=new Shape3D(); PolygonAttributes pa=new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_FILL); pa.setCullFace(PolygonAttributes.CULL_NONE); Material mat=new Material(); mat.setEmissiveColor(new Color3f(0.5f,0.5f,0.5f)); mat.setAmbientColor(new Color3f(0.1f,0.1f,0.1f)); mat.setDiffuseColor(new Color3f(0.2f,0.3f,0.4f)); mat.setSpecularColor(new Color3f(0.6f,0.3f,0.2f)); mat.setLightingEnable(true); RenderingAttributes ra=new RenderingAttributes(); ra.setIgnoreVertexColors(true); ColoringAttributes ca=new ColoringAttributes(); ca.setShadeModel(ColoringAttributes.SHADE_GOURAUD); ca.setColor(new Color3f(0.2f,0.5f,0.9f)); app.setColoringAttributes(ca);
scene.compile(); simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene); BranchGroup lineGroup = new BranchGroup(); Appearance app = new Appearance(); ColoringAttributes ca = new ColoringAttributes(new Color3f(204.0f, 204.0f, 204.0f), ColoringAttributes.SHADE_FLAT); app.setColoringAttributes(ca); pla.setCoordinates(0, plaPts); PointAttributes a_point_just_bigger=new PointAttributes(); a_point_just_bigger.setPointSize(10.0f);//10 pixel-wide point a_point_just_bigger.setPointAntialiasingEnable(true);//now points are sphere-like(not a cube) app.setPointAttributes(a_point_just_bigger); TransformGroup objRotate = new TransformGroup(); objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate.addChild(plShape); lineGroup.addChild(objRotate); return lineGroup;
scene.compile(); simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene); BranchGroup lineGroup = new BranchGroup(); Appearance app = new Appearance(); ColoringAttributes ca = new ColoringAttributes(new Color3f(204.0f, 204.0f, 204.0f), ColoringAttributes.SHADE_FLAT); app.setColoringAttributes(ca); pla.setCoordinates(0, plaPts); Shape3D plShape = new Shape3D(pla, app); TransformGroup objRotate = new TransformGroup(); objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate.addChild(plShape); lineGroup.addChild(objRotate); return lineGroup;
function Alpha() { this.onion = 'onion'; function Beta() { alert(this.onion); } Beta.call(this); } var alpha1 = new Alpha(); // Alerts 'onion'
/** * Get the localToVworld transform for a node. */ void getLocalToVworld(SceneGraphPath path, Transform3D t) { HashKey key = new HashKey(""); if (inSharedGroup == false) { throw new IllegalSharingException(J3dI18N.getString("NodeRetained1")); } path.validate(key); computeLocalToVworld(this, this, key, t); }
/** * Retrieves the vertexFormat of this GeometryArray * @return format of vertices in this GeometryArray * @exception CapabilityNotSetException if the appropriate capability is * not set and this object is part of a live or compiled scene graph */ public int getVertexFormat() { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_FORMAT_READ)) throw new CapabilityNotSetException(J3dI18N.getString("GeometryArray2")); return ((GeometryArrayRetained)this.retained).getVertexFormat(); }
/** * Retrieves the back clip distance. * @return the current back clip distance, in meters */ public double getBackDistance() { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_BACK_DISTANCE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Clip1")); return ((ClipRetained)this.retained).getBackDistance(); }
/** * Retrieve Reverberation Order * @return reverb order * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public int getReverbOrder() { if (!this.getCapability(ALLOW_REVERB_ORDER_READ)) if (isLiveOrCompiled()) throw new CapabilityNotSetException(J3dI18N.getString("AuralAttributes9")); return ((AuralAttributesRetained)this.retained).getReverbOrder(); }
/** * Retrieves the width of this image component object. * @return the width of this image component object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public int getWidth() { if (isLiveOrCompiled()) if(!this.getCapability(ALLOW_SIZE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("ImageComponent0")); return ((ImageComponentRetained)this.retained).getWidth(); }
@Override public Shader[] getShaders() { if (isLiveOrCompiled()) { if(!this.getCapability(ALLOW_SHADERS_READ)) { throw new CapabilityNotSetException(J3dI18N.getString("GLSLShaderProgram1")); } } return ((GLSLShaderProgramRetained)this.retained).getShaders(); }
/** * Retrieves the current transparencyAttributes object. * @return the transparencyAttributes object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public TransparencyAttributes getTransparencyAttributes() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TRANSPARENCY_ATTRIBUTES_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance9")); return ((AppearanceRetained)this.retained).getTransparencyAttributes(); }
/** * Retrieves the current texture object. * @return the texture object * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public Texture getTexture() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_TEXTURE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("Appearance3")); return ((AppearanceRetained)this.retained).getTexture(); }
/** * Retrieves the height of this depth component object. * @return the height of the array of depth values * @exception CapabilityNotSetException if appropriate capability is * not set and this object is part of live or compiled scene graph */ public int getHeight() { if (isLiveOrCompiled()) if (!this.getCapability(ALLOW_SIZE_READ)) throw new CapabilityNotSetException(J3dI18N.getString("DepthComponent0")); return ((DepthComponentRetained)this.retained).getHeight(); }
@Override void setLive(boolean inBackgroundGroup, int refCount) { // Do illegalSharing check. if(getUsedByOffScreen()) { throw new IllegalSharingException(J3dI18N.getString("ImageComponent3")); } super.setLive(inBackgroundGroup, refCount); }
add("Center", canvas3D); BranchGroup scene = createSceneGraph(); scene.compile(); simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene); BranchGroup lineGroup = new BranchGroup(); Appearance app = new Appearance(); Vector3f [] normals=new Vector3f[24]; for(int i=0;i<24;i++)normals[i]=new Vector3f(); pts[23].x=0.5f;pts[23].y=0.5f;pts[23].z=-0.5f; normals[20].y=1;normals[21].y=1;normals[22].y=1;normals[23].y=1; Shape3D sh=new Shape3D(); PolygonAttributes pa=new PolygonAttributes(); pa.setPolygonMode(PolygonAttributes.POLYGON_FILL); pa.setCullFace(PolygonAttributes.CULL_NONE); Material mat=new Material(); mat.setEmissiveColor(new Color3f(0.5f,0.5f,0.5f)); mat.setAmbientColor(new Color3f(0.1f,0.1f,0.1f)); mat.setDiffuseColor(new Color3f(0.2f,0.3f,0.4f)); mat.setSpecularColor(new Color3f(0.6f,0.3f,0.2f)); mat.setLightingEnable(true); RenderingAttributes ra=new RenderingAttributes(); ra.setIgnoreVertexColors(true); ColoringAttributes ca=new ColoringAttributes(); ca.setShadeModel(ColoringAttributes.SHADE_GOURAUD); ca.setColor(new Color3f(0.2f,0.5f,0.9f));
setLayout(new BorderLayout()); GraphicsConfiguration gc=SimpleUniverse.getPreferredConfiguration(); Canvas3D canvas3D = new Canvas3D(gc); add("Center", canvas3D); scene.compile(); simpleU.getViewingPlatform().setNominalViewingTransform(); simpleU.addBranchGraph(scene); BranchGroup lineGroup = new BranchGroup(); Appearance app = new Appearance(); ColoringAttributes ca = new ColoringAttributes(new Color3f(204.0f, 204.0f, 204.0f), ColoringAttributes.SHADE_FLAT); app.setColoringAttributes(ca); PointAttributes a_point_just_bigger=new PointAttributes(); a_point_just_bigger.setPointSize(10.0f);//10 pixel-wide point a_point_just_bigger.setPointAntialiasingEnable(true);//now points are sphere-like(not a cube) app.setPointAttributes(a_point_just_bigger); TransformGroup objRotate = new TransformGroup(); objRotate.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); objRotate.addChild(plShape); lineGroup.addChild(objRotate); return lineGroup;
function Alpha() { this.onion = 'onion'; var Beta = function () { alert(this.onion); }.bind(this); Beta(); } var alpha1 = new Alpha(); // Alerts 'onion'
BackgroundSound mBackgroundSound = new BackgroundSound();