private LightingColorFilter calculateLight(final float rotation){
  final double cosRotation=Math.cos(Math.PI * rotation / 180);
  int intensity=AMBIENT_LIGHT + (int)(DIFFUSE_LIGHT * cosRotation);
  int highlightIntensity=(int)(SPECULAR_LIGHT * Math.pow(cosRotation,SHININESS));
  if (intensity > MAX_INTENSITY) {
    intensity=MAX_INTENSITY;
  }
  if (highlightIntensity > MAX_INTENSITY) {
    highlightIntensity=MAX_INTENSITY;
  }
  final int light=Color.rgb(intensity,intensity,intensity);
  final int highlight=Color.rgb(highlightIntensity,highlightIntensity,highlightIntensity);
  return new LightingColorFilter(light,highlight);
}

private LightingColorFilter calculateLight ( final float rotation ) { final double cosRotation = Math . cos ( Math . PI * rotation / 180 ) ; int intensity = AMBIENT_LIGHT + ( int ) ( DIFFUSE_LIGHT * cosRotation ) ; int highlightIntensity = ( int ) ( SPECULAR_LIGHT * Math . pow ( cosRotation , SHININESS ) ) ; if ( intensity > MAX_INTENSITY ) { intensity = MAX_INTENSITY ; } if ( highlightIntensity > MAX_INTENSITY ) { highlightIntensity = MAX_INTENSITY ; } final int light = Color . rgb ( intensity , intensity , intensity ) ; final int highlight = Color . rgb ( highlightIntensity , highlightIntensity , highlightIntensity ) ; return new LightingColorFilter ( light , highlight ) ; }
calculates the lighting of the item based on rotation .
