# Java 3D Example Programs

### Run the Example Programs

In order to run the Java 3D example programs within your browser, you will need Java Plug-in. Refer to the instructions below for installing and using Java Plug-in.

Java Plug-in on Windows systems
Java Plug-in on Solaris systems

Click on any of the hyperlinks below to run that example program in your browser using Java Plug-in.

#### HelloUniverse

  HelloUniverse

#### AWT_Interaction

  AWTInteraction

#### AlternateAppearance

  AlternateAppearanceBoundsTest
  AlternateAppearanceScopeTest

#### Appearance

  AppearanceTest

#### AppearanceMixed

  AppearanceMixed

#### Background

  BackgroundGeometry

#### Billboard

  Bboard
  BboardPt

#### ConicWorld

  BoxExample
  FlipCylinder
  SimpleCylinder
  TexturedCone
  TexturedSphere
  ConicWorld

#### FourByFour

  FourByFour

#### GearTest

  GearBox
  GearTest

#### GeometryByReference

  GeometryByReferenceTest
  ImageComponentByReferenceTest
  InterleavedTest

#### GeometryCompression

  cgview (runs as an application only)
  obj2cg (runs as an application only)

#### Lightwave

  Viewer (runs as an application only)

#### LOD

  LOD

#### ModelClip

  ModelClipTest
  ModelClipTest2

#### Morphing

  Morphing
  Pyramid2Cube

#### ObjLoad

  ObjLoad (runs as an application only)

#### OffScreenCanvas3D

  OffScreenTest
  PrintFromButton

#### OrientedShape3D

  OrientedTest
  OrientedPtTest

#### PackageInfo

  PackageInfo (runs as an application only)
  QueryProperties (runs as an application only)

#### PickTest

  IntersectTest
  PickTest

#### PickText3D

  PickText3DBounds
  PickText3DGeometry

#### PlatformGeometry

  SimpleGeometry (runs as an application only)

#### PureImmediate

  PureImmediate

#### ReadRaster

  ReadRaster

#### Sound

  MoveAppBoundingLeaf
  ReverberateSound
  SimpleSounds

#### SphereMotion

  SphereMotion

#### SplineAnim

  SplineAnim

#### Text2D

  Text2DTest

#### Text3D

  Text3DLoad

#### TextureByReference

  TextureByReference

#### TextureTest

  MultiTextureTest
  TextureImage

#### TickTockCollision

  TickTockCollision

#### TickTockPicking

  TickTockPicking

#### VirtualInputDevice

  HelloUniverse

### Java Plug-in for Windows

On Windows, the Java Plug-in is automatically installed along with the Java 2 runtime environment. Applets can be run in either Netscape Communicator or Internet Explorer.

Some Java 3D applets require a larger heap size (memory pool) than the default provided by Java Plug-in. To increase the heap size to 64 megabytes, run the Java Plug-in Control Panel application and set the "Java Run Time Parameters" to "`-Xmx64m`". The Java Plug-in Control Panel application can be run from the Start menu in the Programs section.

### Java Plug-in for Solaris

On Solaris, Java 3D applets can be run in Netscape Communicator 4.51 or later on Solaris 2.6 or later. After installing Netscape Communicator, you need to install Java Plug-in version 1.2 or later. Netscape and Java Plug-in are included with Solaris 8, you will need to download and install them for Solaris 2.6 and Solaris 7. Netscape Communicator and Java Plug-in may be downloaded for free from:

`http://www.sun.com/solaris/netscape/`

You should exit from Netscape before installing Java Plug-in. Additional patches may be required (see the website for details).

There is a bug in the Solaris version of Netscape that keeps it from finding Java extensions, such as Java 3D. To work around the problem, you need to copy the jar files into the `lib/` directory in your Java 2 SDK as follows:

`cd $SDKHOME/jre/lib/ext
cp j3daudio.jar ..
cp j3dcore.jar ..
cp j3dutils.jar ..
cp vecmath.jar ..
`

where `$SDKHOME` is the directory containing the Java 2 SDK into which you installed Java 3D (for example, `/home/myhome/Solaris_JDK_1.2.2_05`).

Next, you need to tell Java Plug-in to use the correct version of the Java 2 SDK. This is done using the Java Plug-in Control Panel applet, which can be run from within Netscape.

To change the JRE used by Java Plug-in, follow these instructions:

- Select the "Advanced" tab at the top of the Java Plug-in Control Panel
- Choose "Other..." from the "Java Run Time Environment" pull-down menu
- Type in the path to the `jre` directory in your Java 2 SDK, for example, `/home/myhome/Solaris_JDK_1.2.2_05/jre`.
- Press the "Apply" button

After installing Java Plug-in, you need to exit and restart your Netscape browser. You should ensure that your CLASSPATH environment variable is not set (`unsetenv CLASSPATH`) prior to starting Netscape.

Some Java 3D applets require a larger heap size (memory pool) than the default provided by Java Plug-in. To increase the heap size to 64 megabytes, run the Java Plug-in Control Panel applet and set the "Java Run Time Parameters" to "`-mx64m`".