E-Book, Englisch, 528 Seiten
Davison Pro Java 6 3D Game Development
1. ed
ISBN: 978-1-4302-0212-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
Java 3D, JOGL, JInput and JOAL APIs
E-Book, Englisch, 528 Seiten
ISBN: 978-1-4302-0212-7
Verlag: Apress
Format: PDF
Kopierschutz: 1 - PDF Watermark
This book looks at the two most popular ways of using Java SE 6 to write 3D games on PCs: Java 3D (a high-level scene graph API) and JOGL (a Java layer over OpenGL). Written by Java gaming expert, Andrew Davison, this book uses the new Java (SE) 6 platform and its features including splash screens, scripting, and the desktop tray interface. This book is also unique in that it covers Java game development using the Java 3D API and Java for OpenGL--both critical components and libraries for Java-based 3D game application development
Andrew Davison received his Ph.D. from Imperial College in London in 1989. He was a lecturer at the University of Melbourne for six years before moving to Prince of Songkla University in Thailand in 1996. He has also taught in Bangkok, Khon Kaen, and Hanoi. His research interests include scripting languages, logic programming, visualization, and teaching methodologies. This latter topic led to an interest in teaching games programming in 1999. His O'Reilly book, iKiller Game Programming in Java/i, was published in 2005.
Autoren/Hrsg.
Weitere Infos & Material
1;Contents at a Glance;5
2;Contents;6
3;About the Author;18
4;About the Technical Reviewers;19
5;Acknowledgments;20
6;Introduction;21
6.1;Is This Book for Me?;21
6.2;What’s This Book About?;21
6.3;What’s This Book Not About?;22
6.4;Where’s the CD/ Code?;22
6.5;How Is This Book Different from KGPJ?;22
6.6;Java for Games Programming: Are You Joking?;23
6.7;What About Java on Games Consoles?;24
7;Java 3D;25
7.1;Introducing Java 3D;26
7.1.1;Overview of Java 3D;26
7.1.2;Overview of the Scene Graph;27
7.1.3;Java 3D Strengths;30
7.1.4;Criticisms of Java 3D for Games Programming;32
7.1.5;Alternatives to Java 3D;36
7.1.6;Summary;37
7.2;Get a Life (in 3D);38
7.2.1;The Game of Life;38
7.2.2;Running Life3D;39
7.2.3;An Overview of the Life3D Classes;41
7.2.4;Deciding How to Start;42
7.2.5;Displaying the 3D Game;43
7.2.6;Scene Graph Creation;45
7.2.7;Behaviors in Java 3D;50
7.2.8;A Time- Based Behavior;52
7.2.9;Managing the Grid;52
7.2.10;The Cell;60
7.2.11;Time for Screensavers;68
7.2.12;More Life Required?;70
7.2.13;Summary;71
7.3;Get a Life (the Java 6 Way);72
7.3.1;Life3D Basics;72
7.3.2;An Overview of the Life3D Classes;73
7.3.3;Making a Splash;75
7.3.4;The Desktop API;79
7.3.5;The System Tray;80
7.3.6;Scripting in Java SE 6;90
7.3.7;Scripting in Life3D;97
7.3.8;Summary;104
7.4;The Colliding Grabbers;105
7.4.1;Building Articulated Arms;105
7.4.2;Class Diagrams for Arms3D;106
7.4.3;Creating the Application Window;107
7.4.4;Drawing the 3D Scene;108
7.4.5;Processing the Keys;110
7.4.6;Monitoring Grabber Joints;111
7.4.7;Managing the Grabbers;112
7.4.8;The Grabber;120
7.4.9;Implementing Collision Detection;133
7.4.10;The Floor;138
7.4.11;The Colored Tiles;140
7.4.12;The Floor’s Axes Labels;141
7.4.13;Summary;142
7.5;When Worlds Collide;143
7.5.1;Odejava and ODE;143
7.5.2;Bouncing a Ball;146
7.5.3;Visualizing Balls in a Box;151
7.5.4;A Note of Application Development;165
7.5.5;Summary;166
7.6;A Multitextured Landscape;167
7.6.1;Surveying the Landscape;167
7.6.2;Building the Scene;169
7.6.3;The Multitextured Floor;172
7.6.4;The Splash Shape;184
7.6.5;Moving Balls;192
7.6.6;Driving the Balls;198
7.6.7;More Multitexturing;198
7.6.8;Summary;199
7.7;Walking Around the Models;200
7.7.1;Populating a Scene;200
7.7.2;Class Diagrams for ObjView3D;201
7.7.3;A Spherical Background;202
7.7.4;A Skybox Background;203
7.7.5;A Skybox Built with Quads;204
7.7.6;Loading Models;210
7.7.7;Ground Cover;216
7.7.8;Manipulating the User’s Viewpoint;218
7.7.9;Summary;222
7.8;More Backgrounds and Overlays;223
7.8.1;Retained, Immediate, and Mixed Modes;223
7.8.2;The Earth, Moon, and Mars;224
7.8.3;Spinning the Background;232
7.8.4;The Model Viewer with a Shifting Background and Overlays;239
7.8.5;Summary;249
8;Nonstandard Input Devices;250
8.1;Webcam Snaps;251
8.1.1;Webcam Snaps with TWAIN;251
8.1.2;Displaying Pictures Using TWAIN;252
8.1.3;TWAIN Timing Tests;258
8.1.4;Webcam Snaps with JMF;259
8.1.5;Comparing TWAIN and JMF Capture;265
8.1.6;QTJ;265
8.1.7;Other Uses for Webcam Snaps;266
8.1.8;Summary;267
8.2;Navigating a 3D Scene by Waving Your Arm;268
8.2.1;Using the Wrist Strap;268
8.2.2;Image Processing;270
8.2.3;Finding the Bands;272
8.2.4;Arm Navigation;283
8.2.5;Other Approaches;287
8.2.6;Summary;288
8.3;Building a Gamepad Controller with JInput;289
8.3.1;JInput;289
8.3.2;The Gamepad and Windows;290
8.3.3;Installing and Testing JInput;292
8.3.4;Three JInput Applications;296
8.3.5;A Gamepad Controller;303
8.3.6;Swing and JInput;313
8.3.7;Alternatives to JInput;316
8.3.8;Summary;317
8.4;Gamepad Grabbers;318
8.4.1;Example Overview;318
8.4.2;Playing Sounds;320
8.4.3;Managing Obstacles;323
8.4.4;Collision Detection;326
8.4.5;Sending Input to the Grabbers;327
8.4.6;The Grabbers;334
8.4.7;The Grabber Arms;341
8.4.8;Summary;341
8.5;3D Sound with JOAL;342
8.5.1;Why JOAL and Java 3D?;342
8.5.2;Background on OpenAL and JOAL;343
8.5.3;Managing JOAL Sounds;345
8.5.4;Using JOALSoundMan;355
8.5.5;Other Source Types;361
8.5.6;Summary;362
8.6;The P5 Glove;363
8.6.1;Introducing the P5 Glove;363
8.6.2;Using Kenner’s Java API;365
8.6.3;Examining the Glove’s Data;366
8.6.4;The Glove;371
8.6.5;A Specialized Glove Class;373
8.6.6;A Test Rig for FPSGlove;377
8.6.7;Visiting the Musical Cow;379
8.6.8;The P5 Glove and JInput;386
8.6.9;Summary;387
9;JOGL;388
9.1;Two JOGL Programming Frameworks;389
9.1.1;What Is JOGL?;389
9.1.2;Installing JOGL;390
9.1.3;The Callback Framework;391
9.1.4;Rotating a GLCanvas Cube with Callbacks;393
9.1.5;Rotating a GLJPanel Cube with Callbacks;401
9.1.6;Callback Summary;405
9.1.7;The Active Rendering Framework;405
9.1.8;Rotating a Cube with Active Rendering;407
9.1.9;Java 3D and JOGL;417
9.1.10;More Information on JOGL and OpenGL;418
9.1.11;Summary;419
9.2;Touring the World;420
9.2.1;Application Details;420
9.2.2;Constructing the Canvas;422
9.2.3;The Camera Position;423
9.2.4;Responding to Key Presses;424
9.2.5;Let the Rendering Commence;427
9.2.6;Rendering Initialization;428
9.2.7;The Rendering Loop;432
9.2.8;Updating the Game;432
9.2.9;Rendering the Scene;434
9.2.10;Drawing the Tree Billboard;434
9.2.11;Drawing the Ground Shapes;437
9.2.12;The Planet Earth;439
9.2.13;The Skybox;441
9.2.14;Adding a 2D Overlay;444
9.2.15;Drawing the Floor;446
9.2.16;Summary;449
9.3;Loading Models;450
9.3.1;Overviews of the Examples;450
9.3.2;The OBJ File Format;453
9.3.3;The OBJ File Loader;455
9.3.4;Viewing a Model;468
9.3.5;Other JOGL Model Loaders;470
9.3.6;The TourModelsGL Application;471
9.3.7;Summary;484
10;Index;485




