Inventor uses (128 * shininess) as n, the exponent in the term for specular reflection. You should use (128 * shininess) as your exponent too.
We intentionally did not give you a formula for dropoff. Just as long as you do something reasonable, it will be OK. Create a function that makes good-looking spotlights, and is reasonably efficient. Your function will depend on two values:
cutOffAngle: angle (in radians) at which light is completely attenuated -- if the angle between the vector from the light to the point on the surface and the vector of the light's direction is greater than the cutoff angle, DropOff() should return 0.Don't expect your spotlights to match too closely to Inventor's views. Remember, Inventor is shading only at the vertices of polygons, and you are shading at every pixel. All we ask is that your DropOff() function is reasonable, and it uses the two values above correctly.dropOffRate: ranges from 0 to 1, controlling the softness of the edge of the spotlight, how smoothly DropOff() varies from full to no intensity -- 0 means constant intensity for all angles less than the cutoff angle (with a sudden transition at the cutoff angle), and 1 means the intensity drops off very quickly as you go away from the light's direction, and fades smoothly to black as you approach the cutoff angle.
Nothing. Just ignore it. Sorry about that.
Remember that ray tracing is recursive. Some of your functions will have to call Trace(), and Trace() requires eta as a parameter.