10
Nov
As you see when the dust clears, we
screendist=(double)x0/(Math.tan(viewAngle/2)); //– construct the matrix myWCStoVCSmatrix=new fMatrix3d(); //– myPosition=new fPoint3d(); myAngle=new fAngle3d(); matrixIsDirty=true; } /** * sets the position and angle of the camera. */ public void setOrientation(fPoint3d pos,fAngle3d agl){ if(myPosition.equals(pos)==false){ myPosition.set(pos); matrixIsDirty=true; } if(myAngle.equals(agl)==false){ myAngle.set(agl); matrixIsDirty=true; } } /** * projects an array of 3d points to the temporary 2d buffer */ public fArrayOf2dPoints project(fArrayOf3dPoints p3d){ //– updates the matrix if it needed updateMatrix(); //– transform the WCS vertices to VCS storing the results //– in a buffer myWCStoVCSmatrix.transform(p3d,our3dBuffer); //– project the VCS coordiantes to SCS storing the results //– in a buffer for(int n=0;n
