JAVA 3D Examples

/examples/Animation/Clock.java

Included the following code in Clock.java due to deprecated method (version 1.2)

//cloneNodeComponent() is deprecated - replace with cloneNodeComponent(true) //Appearance bAppear = (Appearance) appear.cloneNodeComponent(); Appearance bAppear = (Appearance) appear.cloneNodeComponent(true);

/examples/Interaction/MousePickApp.java

Deprecated package used (as of 3d v1.2)– see replacement code below:

//com.sun.j3d.utils.behaviors.picking.* package is deprecated - replacement on //next line //import com.sun.j3d.utils.behaviors.picking.*; import com.sun.j3d.utils.picking.behaviors.*;

/examples/Interaction/PickCallbackApp.java

Deprecated package used (as of 3d v1.2) – see replacement code below:

//com.sun.j3d.utils.behaviors.picking.* package is deprecated - replacement on //next line //import com.sun.j3d.utils.behaviors.picking.*; import com.sun.j3d.utils.picking.behaviors.*;

/examples/texture/BoundaryColorApp.java

Deprecated method setTextureCoordinate(int, Point2f) replaced by setTextureCoordinate(int, int, TexCoord2f) see example of code changes below:

/*setTextureCoordinate(int, Point2f) has been deprecated and replaced by setTextureCoordinate(int, int, TexCoord2f)*/

//texturedQuad.setTextureCoordinate(0, new Point2f(-1.0f, 1.5f)); texturedQuad.setTextureCoordinate(0,0, new TexCoord2f(-1.0f, 1.5f)); //texturedQuad.setTextureCoordinate(1, new Point2f(-1.0f,-1.0f)); texturedQuad.setTextureCoordinate(0,1, new TexCoord2f(-1.0f, -1.0f)); //texturedQuad.setTextureCoordinate(2, new Point2f( 1.5f,-1.0f)); texturedQuad.setTextureCoordinate(0,2, new TexCoord2f(1.5f, -1.0f)); //texturedQuad.setTextureCoordinate(3, new Point2f( 1.5f, 1.5f)); texturedQuad.setTextureCoordinate(0,3, new TexCoord2f(1.5f, 1.5f));

/examples/texture/BoundaryModeApp.java

Deprecated method setTextureCoordinate(int, Point2f) replaced with setTextureCoordinate(int, int, TexCoord2f). See example code below:

/*setTextureCoordinate(int, Point2f) has been deprecated and replaced by setTextureCoordinate(int, int, TexCoord2f)*/

//texturedQuad.setTextureCoordinate(0, new Point2f(-1.0f, 1.5f)); texturedQuad.setTextureCoordinate(0,0, new TexCoord2f(-1.0f, 1.5f)); //texturedQuad.setTextureCoordinate(1, new Point2f(-1.0f,-1.0f)); texturedQuad.setTextureCoordinate(0,1, new TexCoord2f(-1.0f, -1.0f)); //texturedQuad.setTextureCoordinate(2, new Point2f( 1.5f,-1.0f)); texturedQuad.setTextureCoordinate(0,2, new TexCoord2f(1.5f, -1.0f)); //texturedQuad.setTextureCoordinate(3, new Point2f( 1.5f, 1.5f)); texturedQuad.setTextureCoordinate(0,3, new TexCoord2f(1.5f, 1.5f));

/examples/texture/MIPmapApp.java

Replaced deprecated method setTextureCoordinate(int, Point2f) with setTextureCoordinate(int, int, TexCoord2f). See code change below:

/*setTextureCoordinate(int, Point2f) is deprecated as of Java3D v1.2 and replaced by setTextureCoordinate(int, int, TexCoord2f)*/

//Point2f q = new Point2f( 0.0f, 1.0f); TexCoord2f q = new TexCoord2f(0.0f, 1.0f); //plane.setTextureCoordinate(0, q); plane.setTextureCoordinate(0, 0, q); q.set(0.0f, 0.0f); //plane.setTextureCoordinate(1, q); plane.setTextureCoordinate(0, 1, q); q.set(1.0f, 0.0f); //plane.setTextureCoordinate(2, q); plane.setTextureCoordinate(0, 2, q); q.set(1.0f, 1.0f); //plane.setTextureCoordinate(3, q); plane.setTextureCoordinate(0, 3, q); examples/texture/MIPmapApp2.java

Same changes as MIPmapApp.java examples/texture/MIPmapDemo.java

Same changes as MIPmapApp.java examples/texture/SimpleTextureApp.java

Same changes as MIPmapApp.java examples/texture/SimpleTextureSpinApp.java

Same changes as MIPmapApp.java examples/texture/Text2DtextureApp.java

Replaced deprecated method setTextureCoordinate(int, Point2f) with setTextureCoordinate(int, int, TexCoord2f). See code changes below:

/* setTextureCoordinates(int, Point2f) is deprecated as of Java3d v1.2 and replaced by setTextureCoordinate(int, int, TexCoord2f) */

//qa.setTextureCoordinate(0, new Point2f(0.0f, 1.0f)); qa.setTextureCoordinate(0, 0, new TexCoord2f(0.0f, 1.0f)); //qa.setTextureCoordinate(1, new Point2f(0.0f, 0.0f)); qa.setTextureCoordinate(0, 1, new TexCoord2f(0.0f, 0.0f)); //qa.setTextureCoordinate(2, new Point2f(1.0f, 0.0f)); qa.setTextureCoordinate(0, 2, new TexCoord2f(1.0f, 0.0f)); //qa.setTextureCoordinate(3, new Point2f(1.0f, 1.0f)); qa.setTextureCoordinate(0, 3, new TexCoord2f(1.0f, 1.0f)); examples/texture/TextureCoordApp.java

Replaced deprecated method setTextureCoordinate(int, Point2f) with setTexturedCordinate(int, int, TexCoord2f). See code changes below:

/* The method setTextureCoordinate(int, Point2f) has been deprecated as of Java3D v1.2. Thus, the method setTextureCoordinate(int, int, TexCoord2f) replaces it. */

//texturedQuad.setTextureCoordinate(0, new Point2f( 0.5f, 0.0f)); texturedQuad.setTextureCoordinate(0, 0, new TexCoord2f(0.5f, 0.0f)); //texturedQuad.setTextureCoordinate(1, new Point2f( 1.0f, 0.5f)); texturedQuad.setTextureCoordinate(0, 1, new TexCoord2f(1.0f, 0.5f)); //texturedQuad.setTextureCoordinate(2, new Point2f( 0.5f, 1.0f)); texturedQuad.setTextureCoordinate(0, 2, new TexCoord2f(0.5f, 1.0f)); //texturedQuad.setTextureCoordinate(3, new Point2f( 0.0f, 0.5f)); texturedQuad.setTextureCoordinate(0, 3, new TexCoord2f(0.0f, 0.5f)); examples/texture/TexturedLinesApp.java

Replaced the deprecated method setTextureCoordinate(int, Point2f) with setTextureCoordinate(int, int, TexCoord2f). See code changes below:

/* Replace the deprecated method setTextureCoordinate(int, Point2f) with setTextureCoordinate(int, int, TexCoord2f) */

//twistStrip.setTextureCoordinate(v, TC1); twistStrip.setTextureCoordinate(0, v, TC1); //twistStrip.setTextureCoordinate(v+1, TC2); twistStrip.setTextureCoordinate(0, v+1, TC2); examples/texture/TexturedPlane.java

Same changes as MIPmapApp.java examples/texture/TexturedSceneApp.java

Same changes as MIPmapApp.java examples/texture/TextureRequestApp.java

Same changes as TextCoordApp.java