10
Nov
As you see when the dust clears, we
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 Implementing a Generic Camera (fGenericCamera) A few details in the implementation need to be discussed before we study the code for the fGenericCamera (Listing 11-8). Listing 11-8 A very generic camera /** * A generic camera. */ public class fGenericCamera extends Object { //– a temporary buffer used for projection protected static fArrayOf2dPoints our2dBuffer= new fArrayOf2dPoints(new int[100],new int[100],100); //– a temporary buffer used for WCS to VCS transform protected static fArrayOf3dPoints our3dBuffer= new fArrayOf3dPoints(new double[100],new double[100],new double[100],100); //– the screen distance protected double screendist; //– screen origo protected int x0,y0; //– the viewangle protected double myViewAngle; //– the matrix used for the WCS to VCS tranform fMatrix3d myWCStoVCSmatrix; //– mark if the matrix is dirty boolean matrixIsDirty; //– the position and angle of the camera in WCS fPoint3d myPosition; fAngle3d myAngle; /** * constructs a camera by specifying the width, height and viewangle */ public fGenericCamera(int width,int height,double viewAngle){ myViewAngle=viewAngle; //– calculate the screen origo x0=width>>1; y0=height>>1; //– calculate the screen distance
Note: If you are looking for inexpensive but high quality provider to host and run your jsp application check Astra jsp hosting services
