Web Hosting Tomcat, Java, JSP, Servlets, J2EE, PHP, MySQL

Cheap web hosting provider

14
Nov

Each fWorld keeps track of its own time

Black Art of Java Game Programming by Joel Fan Sams, Macmillan Computer Publishing ISBN: 1571690433 Pub Date: 11/01/96 Previous Table of Contents Next Understanding the 3D Engine in the Core The 3D engine is a subsystem to the core. It is responsible for rendering the world as seen through a camera. As weird as it may sound, the world can be represented in any way you like. You can use a 2D engine and make a 2D representation, if you like. You can also skip this stage altogether and settle for watching lots of numbers in a console window, but that would be kind of boring. The 3D representation is done using three different cameras: a basic static camera, a ground-faking camera, and a tracking camera that can be hooked to an object. The static camera, fCamera, is a regular camera that has a position and an orientation that can be changed at will. The ground-faking camera, fMagicCamera, can fake ground by drawing a horizon and a grid at ground level, giving a vague impression that there is a ground. The tracking camera, fTrackerCamera, can be hooked to an object. This camera will try to follow the hooked object. By follow, I don t mean look at it, but try to keep up with its position and orientation. This is similar to the spotting camera seen in all flight simulators. All cameras have a method paint(). When this method is called, they will render the world by first determining which objects are visible and then calling the paint() method on each visible fObject. This method is propagated to the fPolyhedronInstance, where the actual painting takes place. The cameras are not part of the virtual world but are only used as a tool to view it. You can place them in the world or hook them to objects, and then at regular time intervals tell them to paint the world as they see it. You can insert an arbitrary number of cameras in your applet that view the world from different positions and angles. This will have a major impact on the performance, though. Building an Application on Top of the Core Now that you know a little about the core, we can start looking at how to use it. The best way to learn something is by looking at examples. Below are two examples that show some of the things that you can do. A Small Example: The Bouncing Boxes

Hint: This post is supported by Gama hrvatski web hosting services

Comments are closed.

Home | About Us | Compare Plans | Standard Hosting | Business Hosting | Java Tomcat Hosting | Support | FAQ | Order Now!

Powered by Omnicus java hosting services. All rights reserved.
Entries (RSS) and Comments (RSS).