public Color3 getColorAt(int a, int b) { Color3 endColor = Color3.BLACK; int i; for (i = 0; i < proj_class.photonmap.getStoredPhotons(); i++) { Photon pho = proj_class.photonmap.getPhoton(i); if (pho != null) { if (((int) pho.x == a) && ((int) pho.z == b)) { float tempr = ((float) pho.R) * (((instrument) proj_class.instruments.get_object(pho.lightSource)).getLevel() / 100); float tempg = ((float) pho.G) * (((instrument) proj_class.instruments.get_object(pho.lightSource)).getLevel() / 100); float tempb = ((float) pho.B) * (((instrument) proj_class.instruments.get_object(pho.lightSource)).getLevel() / 100); if (tempr != 0) { int fake = 0; fake++; } endColor = endColor.add(new Color3(tempr, tempg, tempb)); float newr = (float) endColor.getR(); float newg = (float) endColor.getG(); float newb = (float) endColor.getB(); if (newr > 1) { newr = 1; } if (newg > 1) { newg = 1; } if (newb > 1) { newb = 1; } endColor = new Color3(newr, newg, newb); } } } return endColor; }