All pastes #186724 Raw Edit

Inferno

public java v1 · immutable
#186724 ·published 2006-09-30 11:40 UTC
rendered paste body
while(maxReflectionsLeft > 0 ){  	Vec3 newOrigin = nearestHit.location;					Vec3 newDirection = this.direction.minus(nearestHit.normal.times(this.direction.dot(nearestHit.normal)).times(2.0f));					Ray newRay = new Ray(newOrigin, newDirection);					color = color.add(newRay.trace(nearestHit.object, maxReflectionsLeft).times(nearestHit.object.material.reflectance));				maxReflectionsLeft -= 1;}