I'm trying to write a simple ray tracer as part of a project I am working on (In
java of course). The ray tracer will be use as a benchmarking tool so it doesn't have to be another Prov-Ray
I have put together the bones of a really simple tracing engine but in some simple tests the resulting image does not come out as expected.
In the case of a sphere sitting back from the origin every thing looks ok but when I move the sphere to the left or right of the origin it comes out as an ellipse. The further away from the origin the wider the ellipse becomes(the height stays the same) In the case of the sphere I am using the standard method to calculate the intersection( i.e. solving the quadratic eqn after subbing in values for x, y, z in the equation of a sphere). Shading is modeled using Lamberts law and the light source is at the initial projection point, for now I don't deal with shadows.
I'm at a loss as to why the sphere becomes distorted. Does anyone see something obvious that I might be overlooking ? Thanks