Docsity
Docsity

Prepare-se para as provas
Prepare-se para as provas

Estude fácil! Tem muito documento disponível na Docsity


Ganhe pontos para baixar
Ganhe pontos para baixar

Ganhe pontos ajudando outros esrudantes ou compre um plano Premium


Guias e Dicas
Guias e Dicas


Tutorial Java3D Capitulo 0 - Visão Geral, Notas de estudo de Análise de Sistemas de Engenharia

Tutorial Java3D - Visão Geral Permission to use, copy, modify, and distribute this documentation for NON-COMMERCIAL purposes and without fee is hereby granted provided that this copyright notice appears in all copies.

Tipologia: Notas de estudo

Antes de 2010

Compartilhado em 10/04/2010

alessandro-borges-10
alessandro-borges-10 🇧🇷

3

(2)

12 documentos

1 / 41

Toggle sidebar

Esta página não é visível na pré-visualização

Não perca as partes importantes!

bg1
tutorial v1.5 (Java 3D API v1.1.2)
Getting Started with
the Java 3D API
A Tutorial for Beginners
Chapter 0
Overview and Appendices
Dennis J Bouvier
K Computing
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29

Pré-visualização parcial do texto

Baixe Tutorial Java3D Capitulo 0 - Visão Geral e outras Notas de estudo em PDF para Análise de Sistemas de Engenharia, somente na Docsity!

tutorial v1.5 (Java 3D API v1.1.2)

Getting Started with

the Java 3D

API

A Tutorial for Beginners

Chapter 0

Overview and Appendices

Dennis J Bouvier

K Computing

Getting Started with Java 3D Tutorial Preface

The Java 3D Tutorial

© 1999 Sun Microsystems, Inc. 2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A All Rights Reserved.

The information contained in this document is subject to change without notice.

SUN MICROSYSTEMS PROVIDES THIS MATERIAL "AS IS" AND MAKES NO WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. SUN MICROSYSTEMS SHALL NOT BE LIABLE FOR ERRORS CONTAINED HEREIN OR FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS IN CONNECTION WITH THE FURNISHING, PERFORMANCE OR USE OF THIS MATERIAL, WHETHER BASED ON WARRANTY, CONTRACT, OR OTHER LEGAL THEORY).

THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY MADE TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THE PUBLICATION. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME.

Some states do not allow the exclusion of implied warranties or the limitations or exclusion of liability for incidental or consequential damages, so the above limitations and exclusion may not apply to you. This warranty gives you specific legal rights, and you also may have other rights which vary from state to state.

Permission to use, copy, modify, and distribute this documentation for NON-COMMERCIAL purposes and without fee is hereby granted provided that this copyright notice appears in all copies.

This documentation was prepared for Sun Microsystems by K Computing (530 Showers Drive, Suite 7-225, Mountain View, CA 94040, 770-982-7881, www.kcomputing.com). For further information about course development or course delivery, please contact either Sun Microsystems or K Computing.

Java, JavaScript, Java 3D, HotJava, Sun, Sun Microsystems, and the Sun logo are trademarks or registered trademarks of Sun Microsystems, Inc. All other product names mentioned herein are the trademarks of their respective owners.

Getting Started with Java 3D Tutorial Preface

Getting Started with Java 3D Tutorial Preface

Overview and Appendices

Welcome to version 1.5 of The Java 3D API Tutorial. This tutorial contains seven chapters explaining the most frequently used features of the Java 3D API.

Since the tutorial has been developed and released incrementally, several versions of the tutorial exist. For this reason the revision history may be important to readers of earlier versions. The following table presents the revision history for the tutorial.

Table 0-1 Revision History of the Tutorial.

tutorial version

date new chapter(s) major revision of chapters*

minor revision of chapters*

1.0 Feb 99 1 and 2 n/a n/a

1.1 Apr 99 0 and 6 1 and 2 n/a

1.2 May 99 3 0 and 2 1 and 6

1.3 Jun 99 4 0 1, 2, 3 and 6

1.4 August 99 5 0, 1 and 4 2, 3, and 6

1.5 October 99 7 0 1, 2, 3, 4, 5, and 6

*For the purposes of this table, a major revision is a change to fix a mistake of fact in some part of the chapter. It could be as little as little as changing one line of code, fixing a single sentence, or adding something inadvertently omitted, but involves a fix of substance. A minor revision is a change that does not affect the meaning of the chapter (e.g. formatting, or including new links in the PDF file).

0.1 Navigating the Tutorial

The tutorial is a collection of modules. Each Module is a collection of chapters (except this one, Module 0 has only one chapter, Chapter 0). The chapters in a Module are related. See section 0.1.2 for more information on module and chapter dependencies.

With each chapter of the tutorial being published as separate documents, the following features have been employed:

  • Appendices: To allow easy updates to the Appendices while keeping them centrally located, including the Glossary, are published with Chapter 0 (this chapter). As a consequence, they appear as numbered sections in this document. However, the letter names used in version 1.0 of the tutorial ('A', 'B', and 'C') are retained for compatibility with the older chapters.
  • Page numbering: To allow easy reference to pages in specific chapters, each document's page numbering is prepended with the chapter number. For example, this is page 0-1, which is page one of chapter zero.

Module

Getting Started with Java 3D Tutorial Preface

Module 3: Lights and Textures

Visual richness is added to the virtual universe in this module.

Using lights, material properties, and textures, a Java 3D

programmer can create visually rich objects without creating

complex geometry.

Chapter 6: Lights ........................................................... 34 pages, April 1999

Chapter 7: Textures........................................................ 35 pages, October 1999

Chapter Contents

Here is a listing of the table of contents for each of the published chapters. If you are reading this online you can use the links to the appropriate place in the appropriate document.

Module 1: Getting Started with the Java 3D API

Chapter 1: Getting Started

1.1 What is Java 3D...................................................................................... 1- 1.2 The Java 3D API .................................................................................... 1- 1.3 Building a Scene Graph........................................................................... 1- 1.4 A Basic Recipe for Writing Java 3D Programs ........................................ 1- 1.5 Some Java 3D Terminology..................................................................... 1- 1.6 Simple Recipe Example: HelloJava3Da ................................................... 1- 1.7 Rotating the Cube ................................................................................... 1- 1.8 Capabilities and Performance .................................................................. 1- 1.9 Adding Animation Behavior .................................................................... 1- 1.10 Chapter Summary ................................................................................... 1- 1.11 Self Test ................................................................................................. 1-

Chapter 2: Creating Content

2.1 Virtual Universe Coordinate System ........................................................ 2- 2.2 Visual Object Definition Basics............................................................... 2- 2.3 Geometric Utility Classes ........................................................................ 2- 2.4 Mathematical Classes.............................................................................. 2- 2.5 Geometry Classes.................................................................................... 2- 2.6 Appearance and Attributes ...................................................................... 2- 2.7 Self Test ................................................................................................. 2-

Getting Started with Java 3D Tutorial Preface

Module 2: Interaction and Animation

Module 3: Lights and Textures

  • OVERVIEW AND APPENDICES 0- Table of Contents
    • 0.1 NAVIGATING THE TUTORIAL 0-
      • 0.1.1 Tutorial Contents 0-
        • Module Overview....................................................................................................................................................0-
        • Chapter Contents.....................................................................................................................................................0-
        • What is Not in the Tutorial......................................................................................................................................0-
      • 0.1.2 How Can I Use the Tutorial 0-
      • 0.1.3 Preface to the Tutorial 0-
        • What’s Inside ..........................................................................................................................................................0-
        • How to download this document..............................................................................................................................0-
        • Audience.................................................................................................................................................................0-
        • Feedback.................................................................................................................................................................0-
        • Typographic Conventions ........................................................................................................................................0-
        • What software is required........................................................................................................................................0-
        • Cover Image............................................................................................................................................................0-
      • 0.1.4 Disclaimers.................................................................................................................................... 0-
    • 0.2 (APPENDIX A) SUMMARY OF EXAMPLE PROGRAMS 0-
      • 0.2.1 HelloJava3D.................................................................................................................................. 0-
        • examples/HelloJava3D/HelloJava3Da......................................................................................................................0-
        • examples/HelloJava3D/HelloJava3Db .....................................................................................................................0-
        • examples/HelloJava3D/HelloJava3Dc......................................................................................................................0-
        • examples/HelloJava3D/HelloJava3Dd .....................................................................................................................0-
      • 0.2.2 Geometry 0-
        • examples/Geometry/Axis.java .................................................................................................................................0-
        • examples/Geometry/AxisApp.java...........................................................................................................................0-
        • examples/Geometry/AxisClassDemoApp.java..........................................................................................................0-
        • examples/Geometry/ColorConstants.java .................................................................................................................0-
        • examples/Geometry/ColorYoyoApp.java..................................................................................................................0-
        • examples/Geometry/ConeYoyoApp.java ..................................................................................................................0-
        • examples/Geometry/TwistStrip.java ........................................................................................................................0-
        • examples/Geometry/YoyoApp.java ..........................................................................................................................0-
        • examples/Geometry/YoyoLineApp.java ...................................................................................................................0-
        • examples/Geometry/YoyoPointApp.java ..................................................................................................................0-
      • 0.2.3 EasyContent................................................................................................................................. 0-
        • examples/easyContent/BackgroundApp.java 0-
        • examples/easyContent/GeomInfoApp.java 0-
        • examples/easyContent/Text2Dapp.java.................................................................................................................. 0-
        • examples/easyContent/Text3Dapp.java.................................................................................................................. 0-
      • 0.2.4 Interaction 0-
        • examples/Interaction/DoorApp.java 0-
        • examples/Interaction/KeyNavigatorApp.java.......................................................................................................... 0-
        • examples/Interaction/MouseBehaviorApp.java....................................................................................................... 0-
        • examples/Interaction/MouseNavigatorApp.java 0-
        • examples/Interaction/MousePickApp.java.............................................................................................................. 0-
        • examples/Interaction/MouseRotateApp.java 0-
        • examples/Interaction/MouseRotate2App.java......................................................................................................... 0-
        • examples/Interaction/PickCallbackApp.java 0-
        • examples/Interaction/SimpleBehaviorApp.java 0-
    • 0.2.5 Animation 0- The Java 3D Tutorial 0-ii
      • examples/Animation/AlphaApp.java...................................................................................................................... 0-
      • examples/Animation/BillboardApp.java 0-
      • examples/Animation/ClockApp.java 0-
      • examples/Animation/InterpolatorApp.java 0-
      • examples/Animation/LODApp.java 0-
      • examples/Animation/MorphApp.java..................................................................................................................... 0-
      • examples/Animation/Morph3App.java................................................................................................................... 0-
    • 0.2.6 Light 0-
      • examples/light/LightsNPlanes.java 0-
      • examples/light/LitPlane.java 0-
      • examples/light/LitSphere.java 0-
      • examples/light/LitTwist.java 0-
      • examples/light/LightScope.java 0-
      • examples/light/LocalEyeApp.java.......................................................................................................................... 0-
      • examples/light/ShadowApp.java............................................................................................................................ 0-
      • examples/light/ShininessApp.java 0-
      • examples/light/SpotLightApp.java 0-
    • 0.2.7 Texture......................................................................................................................................... 0-
      • examples/texture/BoundaryColorApp 0-
      • examples/texture/BoundaryModeApp 0-
      • examples/texture/MIPmapApp 0-
      • examples/texture/MIPmapApp2............................................................................................................................. 0-
      • examples/texture/MIPmapDemo............................................................................................................................ 0-
      • examples/texture/SimpleTextureApp..................................................................................................................... 0-
      • examples/texture/SimpleTextureSpinApp.............................................................................................................. 0-
      • examples/texture/Text2DTextureApp 0-
      • examples/texture/TextureCoordApp 0-
      • examples/texture/TextureCoordGenApp 0-
      • examples/texture/TexturedLineApp....................................................................................................................... 0-
      • examples/texture/TexturedPlaneApp 0-
      • examples/texture/TexturedPrimitiveApp................................................................................................................ 0-
      • examples/texture/TexturedSceneApp..................................................................................................................... 0-
      • examples/texture/TextureRequestApp 0-
  • 0.3 (APPENDIX B) REFERENCE MATERIAL 0-
    • 0.3.1 Books........................................................................................................................................... 0-
    • 0.3.2 The Java 3D API can be downloaded from the Java 3D Home Page: 0-
    • 0.3.3 Sun Java Web Pages 0-
    • 0.3.4 Other Web Pages 0-
  • 0.4 (APPENDIX C) SOLUTIONS TO SELECTED SELF TEST QUESTIONS 0-
    • 0.4.1 Answers to Questions in Chapter 1............................................................................................... 0-
    • 0.4.2 Answers to Questions in Chapter 2............................................................................................... 0-
    • 0.4.3 Answers to Questions in Chapter 3............................................................................................... 0-
    • 0.4.4 Answers to Questions in Chapter 4............................................................................................... 0-
    • 0.4.5 Answers to Questions in Chapter 5............................................................................................... 0-
    • 0.4.6 Answers to Questions in Chapter 6............................................................................................... 0-
    • 0.4.7 Answers to Questions in Chapter 7............................................................................................... 0-
  • 0.5 GLOSSARY 0-
  • 3.1 What is in This Chapter 3- Chapter 3: Easier Content Creation
  • 3.2 Loaders................................................................................................... 3-
  • 3.3 GeometryInfo.......................................................................................... 3-
  • 3.4 Text2D 3-
  • 3.5 Text3D 3-
  • 3.6 Background............................................................................................. 3-
  • 3.7 BoundingLeaf 3-
  • 3.8 User Data 3-
  • 3.9 Chapter Summary 3-
  • 3.10 Self Test 3-
  • 4.1 Behavior: the Base for Interaction and Animation 4- Chapter 4: Interaction
  • 4.2 Behavior Basics 4-
  • 4.3 Wakeup Conditions: How Behaviors are Triggered 4-
  • 4.4 Behavior Utility Classes for Keyboard Navigation 4-
  • 4.5 Utility Classes for Mouse Interaction 4-
  • 4.6 Picking 4-
  • 4.7 Chapter Summary 4-
  • 4.8 Self Test 4-
  • 5.1 Animations.............................................................................................. 5- Chapter 5: Animation
  • 5.2 Interpolators and Alpha Object Provide Time-based Animations 5-
  • 5.3 Billboard Class 5-
  • 5.4 Level of Detail (LOD) Animations........................................................... 5-
  • 5.5 Morph..................................................................................................... 5-
  • 5.6 Chapter Summary 5-
  • 5.7 Self Test 5-
  • 6.1 Shading in Java 3D 6- Chapter 6: Lights
  • 6.2 Recipe for Lit Visual Objects 6-
  • 6.3 Light Classes 6-
  • 6.4 Material Object 6-
  • 6.5 Surface Normals 6-
  • 6.6 Specifying the Influence of Lights............................................................ 6-
  • 6.7 Creating Glow-in-the-Dark Objects, Shadows and Other Lighting Issues 6-
  • 6.9 Chapter Summary 6-
  • 6.10 Self-Test 6-

Getting Started with Java 3D Tutorial Preface

Throughout the tutorial are reference blocks - summaries of the API for certain classes. The reference blocks are provided in the tutorial to make reading easier, not to replace the Java 3D API Specification Guide or any other reference. The reference blocks were checked for accuracy when this document was published, but the Java 3D API may have changed. If you are having trouble with a program, be sure to check a current edition of the Java 3D API Specification. Also, refer to section 2.2 (page 2-4) for more information on reference blocks.

0.1.3 Preface to the Tutorial

What’s Inside

This is a tutorial for the Java 3D API version 1.1.2. It is composed of the text (this document), several other text documents and a number of example applications. The text of the tutorial is available in the Acrobat (PDF) file format. The PDF files include thumbnails, links, and bookmarks making them easier to use online. The files are also readable in hardcopy form. However, several of the images are in color and details are lost when printed monochromatically.

How to download this document

The tutorial documents are available online with the source for the example programs, all of which can be downloaded from http://java.sun.com/products/java-media/3D/collateral/

Audience

This tutorial is meant for the Java programmer with some graphics experience, with little or no knowledge of Java 3D. If in addition to being familiar with Java you are familiar with the terms pixel, image plane, RGB, and render, then you have the background to proceed. You don’t need to know about z-buffer, 3D transforms, or any other 3D graphics API to understand this tutorial, but it may help. In any case, this tutorial is written to be very accessible.

Feedback

As with all of our products, we strive for excellence in quality. If you have any questions, comments, or have an error to report, please consult the Java 3D Home Page, http://www.java.sun.com/products/java-media/3D, for contact information.

Typographic Conventions

  • Courier type is used to represent computer code and names of files and directories.
  • Italic type is used for emphasis.
  • Bold is used in the text to indicate program elements
  • Gray background represents Reference Blocks

Double outline sections are advanced sections

Single outline sections are document meta-information sections

What software is required

Consult the Java 3D Home Page for the most current information.

Cover Image

The cover image is of a twisted strip rendered by Java 3D. The program is discussed in Section 2.6. The code is available with the examples distributed with this tutorial.

Getting Started with Java 3D Tutorial Preface

0.1.4 Disclaimers

All software associated with this tutorial is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

This software included with this tutorial is not designed or intended for use in on-line control of aircraft, air traffic, aircraft navigation or aircraft communications; or in the design, construction, operation or maintenance of any nuclear facility. Licensee represents and warrants that it will not use or redistribute the Software for such purposes.

Getting Started with the Java 3D API A. Summary of Example Programs

examples/Geometry/AxisClassDemoApp.java

A ColorCube orbits around the origin in this program. The code of this program does not appear in the text of the tutorial. It simply demonstrates a use of the Axis.java class (see above).

examples/Geometry/ColorConstants.java

This code is an example of a class that defines a number of color constants. The application spins the yo-yo about the y-axis to show the geometry.

examples/Geometry/ColorYoyoApp.java

This program displays a yo-yo using four TriangleFanArray geometry objects with colors. The application spins the yo-yo about the y-axis to show the geometry.

examples/Geometry/ConeYoyoApp.java

This program displays a yo-yo created with two Cone objects. A default Appearance object is used. The application spins the yo-yo about the y-axis to show the geometry.

examples/Geometry/TwistStrip.java

This program displays a twisted strip as an example of using the TriangleStripArray. The twist strip program also demonstrates culling.

examples/Geometry/YoyoApp.java

This program displays a yo-yo visual object created with four TriangleFanArray objects. A default Appearance object is used. The application spins the yo-yo about the y-axis to show the geometry.

examples/Geometry/YoyoLineApp.java

This program displays the TriangleFanArray object with the Appearance set to display lines only. The application spins the yo-yo about the y-axis to show the geometry.

examples/Geometry/YoyoPointApp.java

This program displays the TriangleFanArray object with the Appearance set to points lines only. The application spins the yo-yo about the y-axis to show the geometry.

Getting Started with the Java 3D API A. Summary of Example Programs

0.2.3 EasyContent

examples/easyContent/BackgroundApp.java

This application demonstrates defining geometry for the background of a virtual world. The scene is of a grid of lines to represent the ground, a PointArray for stars, and a LineArray for a constellation. The stars and constellation are in the background. The viewer can move around in the scene and experience the relative motion between the ground and the stars in the background.

The interaction (motion) is provided through the KeyNavigator class (documented in Chapter 4) and a BoundingLeaf application bounds, which provides interaction in the virtual world without bounds. The BoundingLeaf is added to the view branch graph in this application.

examples/easyContent/GeomInfoApp.java

This application demonstrates the use of the GeometryInfo class to create Java 3D geometry specified by arbitrary polygons. This application creates the surface of a car using polygons. The Triangulator, Stripifier, and NormalGenerator classes are used to convert the polygons into triangle strips with normals so the specified geometry can be shaded. A wire frame view of the geometry can be viewed by providing any command line argument when invoking the program. For example: java GeomInfoApp -lines will show the wire frame instead of the shaded surfaces.

examples/easyContent/Text2Dapp.java

A simple example of using the Text2D object to add text to a Java 3D virtual world. The Text2D object rotates in the virtual world.

examples/easyContent/Text3Dapp.java

A simple example of using the Text3D object to add text to a Java 3D virtual world. The Text3D object rotates in the virtual world.

0.2.4 Interaction

The programs collected in the examples/Interaction subdirectory correspond to the topics presented in Chapter 4. Creating and using behaviors to provide user interaction is the subject of the chapter.

examples/Interaction/DoorApp.java

This program demonstrates using the postId() method and WakeupOnBehaviorPost WakeupCriterion objects to coordinate behavior objects. In this program two behavior classes are defined: OpenBehavior and CloseBehavior. Then one instance of each behavior class are used to open and close a door. Actually, a ColorCube is used as a stand-in for the door.

examples/Interaction/KeyNavigatorApp.java

This program demonstrates using a KeyNavigatorBehavior object to provide keyboard based viewer navigation in the virtual world. The user is able to press keys to move forward, back, left, right, up and down as well as rotate left, right, up and down.

Getting Started with the Java 3D API A. Summary of Example Programs

examples/Animation/BillboardApp.java

This program illustrates the billboard behavior provided by Billboard Class objects. A Billboard object orients a visual object such that it always faces the viewer. The user of this program is free to navigate the virtual world using the arrow keys. Refer to Section 5.3 for more information on applications and API of the Billboard Class.

examples/Animation/ClockApp.java

This program uses one Alpha object and one RotationInterpolator to rotate an analog clock face once per minute. The clock face, defined in Clock.java, is constructed from one Alpha object and two RotationInterplotors. The main program, in ClockApp.java, is a simple example of using a RotationInterpolator. The construction of the clock is somewhat more complex.

examples/Animation/InterpolatorApp.java

This program illustrates six different interpolator classes in one scene to illustrate the variety of interpolator classes available.

examples/Animation/LODApp.java

This program uses a DistanceLOD object to represent a visual object as one of several different geometric representations of varying levels of detail. The DistanceLOD object picks one of the geometric representations based on the distance between the visual object and the viewer.

examples/Animation/MorphApp.java

In this program, a custom behavior classes animates a stick figure walking based on four GeometryArray object key frames. Of course, to truly appreciate the animations, you have to run the program.

examples/Animation/Morph3App.java

In this program, three other behavior classes create animations based on some, or all, of the GeometryArray objects of MorphApp. They are called (left to right in the figure) "In Place", "Tango", and "Broken". Not all of the animations are good. Of course, to truly appreciate the animations, you have to run the program.

0.2.6 Light

examples/light/LightsNPlanes.java

This program renders a scene where three planes are lit by three different lights. One light is directional, one is a point light, and one is a spot light. See Figure 6-16.

examples/light/LitPlane.java

This program is a basic example of using lights. It renders a scene with a plane and a sphere. See Figure 6-2.

examples/light/LitSphere.java

This program is a basic example of using lights. It renders a scene with a single sphere. See Figure 6-15, among others.

examples/light/LitTwist.java

This program demonstrates the lighting of a two sided object (setBackFaceNormalsFlip()).See Figure 6-21.

Getting Started with the Java 3D API A. Summary of Example Programs

examples/light/LightScope.java

This program demonstrates the use of scoping to limit the influence of light sources. See Figure 6-25.

examples/light/LocalEyeApp.java

This program illustrates the difference between local eye lighting and infinite eye lighting. See Figure 6-29.

examples/light/ShadowApp.java

This program demonstates SimpleShadow class. SimpleShadow creates shadow polygons for simple visual objects in certain scenes. See Figure 6-28.

examples/light/ShininessApp.java

This program renders a static scene of nine spheres with different material properties. The only difference among the material properties of the spheres is the shininess value. See Figure 6-20.

examples/light/SpotLightApp.java

This program illustrates the difference various values for the spot light parameters make in rendering. See Figure 6-18.

0.2.7 Texture

examples/texture/BoundaryColorApp

This program loads a single texture image into four Texture2D objects for use with four visual objects. Each of the four textures are configured with a Boundary Color and different Boundary Mode settings. The resulting image illustrates the interaction between the Boundary Mode setting in the presence of a Boundary Color.

examples/texture/BoundaryModeApp

This program loads a single texture image into four Texture2D objects for use with four visual objects. Each of the four textures are configured with a different set of Boundary Mode settings (CLAMP or WRAP). The resulting image illustrates the possible combinations of Boundary Mode setting for a 2D texture.

examples/texture/MIPmapApp

This program loads a single texture image into a Texture2D object with the MIPmap Mode set to MULTI_LEVEL. The images for each level (other than the base level) are created at runtime from the loaded base image by the TextureLoader utility. Compare this program to MIPmapApp2.

examples/texture/MIPmapApp

This program loads multiple texture images into a Texture2D object with the MIPmap Mode set to MULTI_LEVEL. Each image is loaded by the TextureLoader utility. Compare this program to MIPmapApp.

examples/texture/MIPmapDemo

This program loads multiple texture images into a Texture2D object with the MIPmap Mode set to MULTI_LEVEL. Each image is loaded by the TextureLoader utility. The texture images used distinguish this application from the typical MIPmap application. The textures are solid color and alternate between red and green on each level. The resulting image shows how textures from a variety of levels can be used for a single visual object.

Getting Started with the Java 3D API B. Reference Material

0.3 (Appendix B) Reference Material

0.3.1 Books

Henry Sowizral, Kevin Rushforth, and Michael Deering, The Java 3D API Specification , Addison- Wesley, Reading, Mass., December 1997. ISBN 0-201-32576- This book describes version 1.0 of the Java 3D API. There are some differences between this specification and the current release of the product. It is comprehensive in coverage, but not intended as a programmer’s guide. It is also available online at http://java.sun.com/products/java-media/3D It is also available in Japanese: translated by Yukio Andoh, Rika Takeuchi; ISBN 4-7561-3017-

Ken Arnold and James Gosling, The Java Programming Language , Addison-Wesley, Reading, Mass. The Java reference.

David M. Geary, graphic JAVA Mastering the AWT , Sunsoft Press, 1997 Complete coverage of the AWT.

Foley, vanDam, Feiner, and Hughes, Computer Graphics , Addison-Wesley This book is widely considered the “bible of computer graphics”. Comprehensive coverage of general computer graphics concepts including representation of points, lines, surfaces, and transformations. Other topics include projection, texturing, z-buffer, and many, many others.

OpenGL ARB, OpenGL Programming Guide , Addison-Wesley While not directly related, this book provides a good foundation in graphics programming via the OpenGL API. Java 3D resembles OpenGL in many ways and some implementations of Java 3D are built on an OpenGL implementation.

0.3.2 The Java 3D API can be downloaded from the Java 3D Home Page:

http://java.sun.com/products/java-media/3D/

Follow the "Java 3D Implementation" link to the download.html page. Also from this page, you can download documentation for Java 3D API classes.

0.3.3 Sun Java Web Pages

For additional information, refer to these Sun Microsystems pages on the World Wide Web:

http://java.sun.com/products/java-media/3D

The Java 3D marketing homepage, this links to many related pages.

http://java.sun.com/

The Java Software web site, with the latest information on Java technology, product information, news, and features.

Getting Started with the Java 3D API B. Reference Material

http://java.sun.com/products/jdk/1.2/ JDK 1.2 Product and Download Page

http://java.sun.com/docs Java Platform Documentation provides access to white papers, the Java Tutorial and other documents.

http://developer.java.sun.com/ The Java Developer Connection web site. (Free registration required.) Additional technical information, news, and features; user forums; support information, and much more.

http://java.sun.com/products/ Java Technology Products & API

http://www.sun.com/solaris/java/ Java Development Kit for Solaris - Production Release

0.3.4 Other Web Pages

For additional information, refer to the the Java 3D web page for links to related resources.