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

Cheap web hosting provider

12
Nov

Black Art of Java Game Programming by Joel

myAngle=new fAngle3d(); myTransformMatrix=new fMatrix3d(); } /** * set the position and angle for this polyhedron instance. */ public void setOrientation(fPoint3d pos,fAngle3d agl){ if(myPosition.equals(pos)==false){ //– if position has changed then mark the matrix //– as “dirty” meaning that the transformed points //– need to be updated. myPosition.set(pos); positionIsDirty=true; } if(myAngle.equals(agl)==false){ myAngle.set(agl); angleIsDirty=true; } } /** * paint the polyhedron instance. */ public void paint(Graphics g,fGenericCamera camera){ if(positionIsDirty || angleIsDirty){ //– position or angle has changed and the transformed //– vertices need to be updated. myTransformMatrix.makeMCStoWCStransform(myPosition,myAngle); //– transform the polyhedron model coordinates to world coords. myTransformMatrix.transform(thePolyhedron.getVertices(),transformedVertic es); //– positionIsDirty=angleIsDirty=false; } //– project the WCS to the screen with the supplied camera //– and then call the paint method of the polyhedron with //– the returned 2d array thePolyhedron.paint(g,camera.project(transformedVertices)); } } The Array transformedVertices This array is used for storing the world coordinates of the polyhedron s vertices. Since many objects are static, it is a good idea to save this information to eliminate redundant recalculations. Understanding the paint() Method
Note: If you are looking for inexpensive but high quality provider to host and run your jsp application check Astra jsp 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).