Pro Java 6 3D Game Development (eBook)
XXIII, 485 Seiten
Apress (Verlag)
978-1-4302-0212-7 (ISBN)
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.
Create strange lands filled with mysterious objects (cows frozen in blocks of ice, chirping penguins, golden globes with wavering eyes) and throw away your keyboard and mouse, to go exploring armed only with a gamepad, power glove, or just your bare hands!Java gaming expert Andrew Davison will show you how to develop and program 3D games in Java technology on a PC, with an emphasis on the construction of 3D landscapes. It's assumed you have a reasonable knowledge of Javathe sort of thing picked up in a first Java course at school.Topics are split into three sections: Java 3D API, non-standard input devices for game playing, and JOGL. Java 3D is a high-level 3D graphics API, and JOGL is a lower-level Java wrapper around the popular OpenGL graphics API.You'll look at three non-standard input devices: the webcam, the game pad, and the P5 data glove. Along the way, you'll utilize several other games-related libraries including: JInput, JOAL, JMF, and Odejava.Learn all the latest Java SE 6 features relevant to gaming, including: splash screens, JavaScript scripting as well as the desktop and system tray interfaces.Unique coverage of Java game development using both the Java 3D API and Java for OpenGL, as well as invaluable experience from a recognized Java gaming guru, will provide you with a distinct advantage after reading this book.
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.
Contents at a Glance 5
Contents 6
About the Author 18
About the Technical Reviewers 19
Acknowledgments 20
Introduction 21
Is This Book for Me? 21
What’s This Book About? 21
What’s This Book Not About? 22
Where’s the CD/ Code? 22
How Is This Book Different from KGPJ? 22
Java for Games Programming: Are You Joking? 23
What About Java on Games Consoles? 24
Java 3D 25
Introducing Java 3D 26
Overview of Java 3D 26
Overview of the Scene Graph 27
Java 3D Strengths 30
Criticisms of Java 3D for Games Programming 32
Alternatives to Java 3D 36
Summary 37
Get a Life (in 3D) 38
The Game of Life 38
Running Life3D 39
An Overview of the Life3D Classes 41
Deciding How to Start 42
Displaying the 3D Game 43
Scene Graph Creation 45
Behaviors in Java 3D 50
A Time- Based Behavior 52
Managing the Grid 52
The Cell 60
Time for Screensavers 68
More Life Required? 70
Summary 71
Get a Life (the Java 6 Way) 72
Life3D Basics 72
An Overview of the Life3D Classes 73
Making a Splash 75
The Desktop API 79
The System Tray 80
Scripting in Java SE 6 90
Scripting in Life3D 97
Summary 104
The Colliding Grabbers 105
Building Articulated Arms 105
Class Diagrams for Arms3D 106
Creating the Application Window 107
Drawing the 3D Scene 108
Processing the Keys 110
Monitoring Grabber Joints 111
Managing the Grabbers 112
The Grabber 120
Implementing Collision Detection 133
The Floor 138
The Colored Tiles 140
The Floor’s Axes Labels 141
Summary 142
When Worlds Collide 143
Odejava and ODE 143
Bouncing a Ball 146
Visualizing Balls in a Box 151
A Note of Application Development 165
Summary 166
A Multitextured Landscape 167
Surveying the Landscape 167
Building the Scene 169
The Multitextured Floor 172
The Splash Shape 184
Moving Balls 192
Driving the Balls 198
More Multitexturing 198
Summary 199
Walking Around the Models 200
Populating a Scene 200
Class Diagrams for ObjView3D 201
A Spherical Background 202
A Skybox Background 203
A Skybox Built with Quads 204
Loading Models 210
Ground Cover 216
Manipulating the User’s Viewpoint 218
Summary 222
More Backgrounds and Overlays 223
Retained, Immediate, and Mixed Modes 223
The Earth, Moon, and Mars 224
Spinning the Background 232
The Model Viewer with a Shifting Background and Overlays 239
Summary 249
Nonstandard Input Devices 250
Webcam Snaps 251
Webcam Snaps with TWAIN 251
Displaying Pictures Using TWAIN 252
TWAIN Timing Tests 258
Webcam Snaps with JMF 259
Comparing TWAIN and JMF Capture 265
QTJ 265
Other Uses for Webcam Snaps 266
Summary 267
Navigating a 3D Scene by Waving Your Arm 268
Using the Wrist Strap 268
Image Processing 270
Finding the Bands 272
Arm Navigation 283
Other Approaches 287
Summary 288
Building a Gamepad Controller with JInput 289
JInput 289
The Gamepad and Windows 290
Installing and Testing JInput 292
Three JInput Applications 296
A Gamepad Controller 303
Swing and JInput 313
Alternatives to JInput 316
Summary 317
Gamepad Grabbers 318
Example Overview 318
Playing Sounds 320
Managing Obstacles 323
Collision Detection 326
Sending Input to the Grabbers 327
The Grabbers 334
The Grabber Arms 341
Summary 341
3D Sound with JOAL 342
Why JOAL and Java 3D? 342
Background on OpenAL and JOAL 343
Managing JOAL Sounds 345
Using JOALSoundMan 355
Other Source Types 361
Summary 362
The P5 Glove 363
Introducing the P5 Glove 363
Using Kenner’s Java API 365
Examining the Glove’s Data 366
The Glove 371
A Specialized Glove Class 373
A Test Rig for FPSGlove 377
Visiting the Musical Cow 379
The P5 Glove and JInput 386
Summary 387
JOGL 388
Two JOGL Programming Frameworks 389
What Is JOGL? 389
Installing JOGL 390
The Callback Framework 391
Rotating a GLCanvas Cube with Callbacks 393
Rotating a GLJPanel Cube with Callbacks 401
Callback Summary 405
The Active Rendering Framework 405
Rotating a Cube with Active Rendering 407
Java 3D and JOGL 417
More Information on JOGL and OpenGL 418
Summary 419
Touring the World 420
Application Details 420
Constructing the Canvas 422
The Camera Position 423
Responding to Key Presses 424
Let the Rendering Commence 427
Rendering Initialization 428
The Rendering Loop 432
Updating the Game 432
Rendering the Scene 434
Drawing the Tree Billboard 434
Drawing the Ground Shapes 437
The Planet Earth 439
The Skybox 441
Adding a 2D Overlay 444
Drawing the Floor 446
Summary 449
Loading Models 450
Overviews of the Examples 450
The OBJ File Format 453
The OBJ File Loader 455
Viewing a Model 468
Other JOGL Model Loaders 470
The TourModelsGL Application 471
Summary 484
Index 485
Erscheint lt. Verlag | 1.1.2008 |
---|---|
Zusatzinfo | XXIII, 528 p. |
Verlagsort | Berkeley |
Sprache | englisch |
Themenwelt | Informatik ► Programmiersprachen / -werkzeuge ► Java |
Informatik ► Software Entwicklung ► Spieleprogrammierung | |
Mathematik / Informatik ► Informatik ► Web / Internet | |
Informatik ► Weitere Themen ► Computerspiele | |
Schlagworte | Development • Framework • interfaces • Java • JavaScript • programming |
ISBN-10 | 1-4302-0212-2 / 1430202122 |
ISBN-13 | 978-1-4302-0212-7 / 9781430202127 |
Haben Sie eine Frage zum Produkt? |
Größe: 6,0 MB
DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasserzeichen und ist damit für Sie personalisiert. Bei einer missbräuchlichen Weitergabe des eBooks an Dritte ist eine Rückverfolgung an die Quelle möglich.
Dateiformat: PDF (Portable Document Format)
Mit einem festen Seitenlayout eignet sich die PDF besonders für Fachbücher mit Spalten, Tabellen und Abbildungen. Eine PDF kann auf fast allen Geräten angezeigt werden, ist aber für kleine Displays (Smartphone, eReader) nur eingeschränkt geeignet.
Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.
Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.
Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.
aus dem Bereich