Amiga.org
Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: JetRacer on November 16, 2003, 12:00:17 PM
-
When a raytracer inside/outside (object) test is performed, a positive or negative float is returned, right?
Is this float the exact distance between the surface and the ray?
-
JetRacer wrote:
When a raytracer inside/outside (object) test is performed, a positive or negative float is returned, right?
Is this float the exact distance between the surface and the ray?
I'm not sure I understand what you mean with inside/outside tests...
Most tests assume that the ray is given as
r = P + t*d
with P being the origin point of the ray (eye or previous intersection), d being the direction vector, and t being a parameter in the range [0..+inf]. Most intersection tests will return the t of the intersection. Thus you can calculate the point of intercept by replacing the returned t in the above equation.
Is that what you mean?
-
Sorry, I should have been more specific.
In the case of a native object, I shoot a ray and give it's coordinates (as distance equals object distance from camera) to the native formula which then return a float. This float is positive if the ray miss, or negative if ray hits.
Is this float reflecting distance; ray vs surface?
-
JetRacer wrote:
Sorry, I should have been more specific.
In the case of a native object, I shoot a ray and give it's coordinates (as distance equals object distance from camera) to the native formula which then return a float. This float is positive if the ray miss, or negative if ray hits.
Is this float reflecting distance; ray vs surface?
What do you mean with "native formula"? Can you give an example of the type of primitive and the formula you are using?
-
JetRacer wrote:
When a raytracer inside/outside (object) test is performed, a positive or negative float is returned, right?
Is this float the exact distance between the surface and the ray?
Are you saying that the value returned is the (scalar) distance of 'current' position along the ray, from the point on the surface that the ray intersects?
Thats the only logical way I can see that the value would have a different sign on different sides of the surface.