static void initPUnsorted(Triangulator triRef, int number) { if (number > triRef.maxNumPUnsorted) { triRef.maxNumPUnsorted = number; triRef.pUnsorted = new Point2f[triRef.maxNumPUnsorted]; for(int i = 0; i<triRef.maxNumPUnsorted; i++) triRef.pUnsorted[i] = new Point2f(); } }
static void sort(Point2f points[], int numPts) { int i,j; Point2f swap = new Point2f(); for (i = 0; i < numPts; i++){ for (j = i + 1; j < numPts; j++){ if (pComp(points[i], points[j]) > 0){ swap.set(points[i]); points[i].set(points[j]); points[j].set(swap); } } } /* for (i = 0; i < numPts; i++) { System.out.println("pt " + points[i]); } */ }
Point2f srcTri = new Point2f(3); Point2f dstTri = new Point2f(3); // ... srcTri.position(0).x((float)landmarks[5*2]).y((float)landmarks[5*2+1]); srcTri.position(1).x((float)landmarks[6*2]).y((float)landmarks[6*2+1]); srcTri.position(2).x((float)landmarks[0*2]).y((float)landmarks[0*2+1]); // and do the same for dstTri warp_mat = getAffineTransform( srcTri.position(0), dstTri.position(0) );
/** * @deprecated As of Java 3D version 1.2, replaced by * <code>getTextureCoordinate(int texCoordSet, TexCoord2f texCoord)</code> */ public void getTextureCoordinate(int index, Point2f texCoord) { getTextureCoordinate(0, index, texCoord2fArray[0]); texCoord.set(texCoord2fArray[0]); }
@Override public void run() { cp.add(v); //Utils.log2("advanced by x,y = " + cp.x + ", " + cp.y); int x, y; if (v.lengthSquared() >= sqdist_to_travel) { // set target position x = startSrcRect.x + dx; y = startSrcRect.y + dy; // quit animation cancelAnimation(sf[0]); } else { // set position x = startSrcRect.x + (int)(cp.x); y = startSrcRect.y + (int)(cp.y); } setSrcRect(x, y, startSrcRect.width, startSrcRect.height); display.repaintAll2(); } }, 0, 50, TimeUnit.MILLISECONDS);
triRef.pUnsorted[i].set(triRef.points[i]);
@Override Object get() { Tuple2f[] arr = new Tuple2f[this.length]; for (int i = 0; i < this.length; i++) { int j = i * 2; arr[i] = new Point2f(); arr[i].x = this.value[j+0]; arr[i].y = this.value[j+1]; } return arr; }
void initPnts(int number) { if (maxNumPoints < number) { maxNumPoints = number; points = new Point2f[maxNumPoints]; } for(int i = 0; i<number; i++) points[i] = new Point2f(0.0f, 0.0f); numPoints = 0; }
@Override Object get() { return new Point2f(value); }
int storePoint(double x, double y) { int i; if (numPoints >= maxNumPoints) { // System.out.println("Triangulator:storePoint Expanding points array ..."); maxNumPoints += INC_POINT_BK; Point2f old[] = points; points = new Point2f[maxNumPoints]; if(old != null) System.arraycopy(old, 0, points, 0, old.length); } points[numPoints] = new Point2f((float)x, (float)y); // points[numPoints].x = (float)x; // points[numPoints].y = (float)y; i = numPoints; ++numPoints; return i; }
Point2f vertex = new Point2f(); flag = pIt.currentSegment(tmpCoords); if (flag == PathIterator.SEG_LINETO){
attenuation[i] = new Point2f(this.attenuationDistance[i], this.attenuationGain[i]);
geom.setCoordinates(coords); Point2f[] text = new Point2f[16]; text[0] = new Point2f( -6.0f, -17.5f); text[1] = new Point2f( -6.0f, -9.0f); text[2] = new Point2f( -6.0f, -5.0f); text[3] = new Point2f( -6.0f, 0.0f); text[4] = new Point2f( -0.75f, 0.0f); text[5] = new Point2f( -0.25f, -5.0f); text[6] = new Point2f( -0.25f, -9.0f); text[7] = new Point2f(-0.125f, -15.0f); text[8] = new Point2f( 0.125f, -15.0f); text[9] = new Point2f( 0.25f, -9.0f); text[10] = new Point2f( 0.25f, -5.0f); text[11] = new Point2f( 0.75f, 0.0f); text[12] = new Point2f( 6.0f, 0.0f); text[13] = new Point2f( 6.0f, -5.0f); text[14] = new Point2f( 6.0f, -9.0f); text[15] = new Point2f( 6.0f, -17.5f); geom.setTextureCoordinates(text);
attenuation[i] = new Point2f(this.backAttenuationDistance[i], this.backAttenuationGain[i]);
v.normalize(); v.scale(20/mag); final Point2f cp = new Point2f(0, 0); // the current deltas
Point2f[] backAttenuation = new Point2f[arraySize]; for (int i=0; i< arraySize; i++) { attenuation[i] = new Point2f(); backAttenuation[i] = new Point2f(); Point2f[] attenuation = new Point2f[arraySize]; for (int i=0; i< arraySize; i++) attenuation[i] = new Point2f(); ptSound.getDistanceGain(attenuation); double[] frontDistance = new double[arraySize];
center = new Point2f(); Basic.vectorAdd2D(triRef.points[i1], triRef.points[i2[0]], center); Basic.multScalar2D(0.5, center);