protected void lightSpot(int num, float angle, float exponent) { lightSpotParameters[2 * num + 0] = Math.max(0, PApplet.cos(angle)); lightSpotParameters[2 * num + 1] = exponent; }
protected void lightSpot(int num, float angle, float exponent) { lightSpotParameters[2 * num + 0] = Math.max(0, PApplet.cos(angle)); lightSpotParameters[2 * num + 1] = exponent; }
/** * ( begin auto-generated from PVector_rotate.xml ) * * Rotate the vector by an angle (only 2D vectors), magnitude remains the same * * ( end auto-generated ) * * @webref pvector:method * @usage web_application * @brief Rotate the vector by an angle (2D only) * @param theta the angle of rotation */ public void rotate(float theta) { float xTemp = x; // Might need to check for rounding errors like with angleBetween function? x = x*PApplet.cos(theta) - y*PApplet.sin(theta); y = xTemp*PApplet.sin(theta) + y*PApplet.cos(theta); }
/** * ( begin auto-generated from PVector_rotate.xml ) * * Rotate the vector by an angle (only 2D vectors), magnitude remains the same * * ( end auto-generated ) * * @webref pvector:method * @usage web_application * @brief Rotate the vector by an angle (2D only) * @param theta the angle of rotation */ public PVector rotate(float theta) { float temp = x; // Might need to check for rounding errors like with angleBetween function? x = x*PApplet.cos(theta) - y*PApplet.sin(theta); y = temp*PApplet.sin(theta) + y*PApplet.cos(theta); return this; }
static private void invRotate(PMatrix3D matrix, float angle, float v0, float v1, float v2) { float c = PApplet.cos(-angle); float s = PApplet.sin(-angle); float t = 1.0f - c; matrix.preApply((t*v0*v0) + c, (t*v0*v1) - (s*v2), (t*v0*v2) + (s*v1), 0, (t*v0*v1) + (s*v2), (t*v1*v1) + c, (t*v1*v2) - (s*v0), 0, (t*v0*v2) - (s*v1), (t*v1*v2) + (s*v0), (t*v2*v2) + c, 0, 0, 0, 0, 1); }
static private void invRotate(PMatrix3D matrix, float angle, float v0, float v1, float v2) { float c = PApplet.cos(-angle); float s = PApplet.sin(-angle); float t = 1.0f - c; matrix.preApply((t*v0*v0) + c, (t*v0*v1) - (s*v2), (t*v0*v2) + (s*v1), 0, (t*v0*v1) + (s*v2), (t*v1*v1) + c, (t*v1*v2) - (s*v0), 0, (t*v0*v2) - (s*v1), (t*v1*v2) + (s*v0), (t*v2*v2) + c, 0, 0, 0, 0, 1); }
float c = PApplet.cos(angle); float s = PApplet.sin(angle);
float c = PApplet.cos(angle); float s = PApplet.sin(angle);
float alpha = 200 * ((1 - PApplet.cos(a)) * 0.5f); pg.fill(color(160, alpha)); pg.noStroke();
float corrAlpha = (1 - PApplet.cos(a)) * 0.5f; boolean selCorrTri = false;