[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Openexr-devel] Request for trivial addition?
From: |
Florian Kainz |
Subject: |
Re: [Openexr-devel] Request for trivial addition? |
Date: |
Mon, 27 Jan 2003 17:18:48 -0800 |
Hi Scott,
sorry for the late reply. I will add a Sphere::intersectT()
function to Imath (and, in the header file, I will try to
document what intersect() and intersectT() actually do).
The changes should show up in the next release of OpenEXR.
Florian
"E. Scott Larsen" wrote:
>
> As I was flipping through the code this afternoon to get a look at the
> usefulness of it all, I was struck by the <object>::intersect(Line3....)
> functions (specifically in Imath/ImathSphere.h and Imath/ImathPlane.h).
> For the plane, there are two:
>
> bool Plane::intersect(const Line3<T>&, Vec3<T>&)const;
> bool Plane::intersectT(const Line3<T>&, T&)const;
>
> the first passes back the point of intersection and the second the
> distance along the line of the intersection. Good. For the sphere, there
> is only one:
>
> bool Sphere::intersect(const Line3<T>&, Vec3<T>&)const;
>
> which finds the point of intersection. The distance along the line is
> sure useful though. Yea, distance from a point to a point will give that,
> but that's costly, and the dumb thing then would be that the distance is
> already computed! Implementation of Sphere::intersect() looks like this:
> {
> //find the distance along the line of the intersection, call it t
> //get the point via the nice line(t) call
> }
> So, would it be possible to add an additional function:
>
> bool Sphere::intersectT(const Line3<T>&, T&)const;
>
> which is implemented exactly like the other one, except it doesn't do the
> last step and passes t back instead of the point? This is exactly what
> the Plane code does (identical copy, just omits the last line).
>
> This should take 48 seconds, and I can give you a patch if you want, any
> format you like (whoever you is).
>
> Thanks!
>
> //Scott
>
> _______________________________________________
> Openexr-devel mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/openexr-devel