I am writing my own raytracer and now I have struck upon a problem I have not been able to solve so far.

I am trying to calculate the influence of a triangle-light (a triangle that emits light) on a point on another triangle. For this I want to calculate the surface area of the projection of that triangle-light upon the unit sphere around the point.

I fount the following explanation of how to calculate this:
http://mathforum.org/library/drmath/view/51774.html

This seems to use the same method I found somewhere else, so I suppose the explanation is correct. My code however is incorrect, for the resulting value gets larger as the triangle gets farther from the unit sphere, which is of cource incorrect. My code (C++):

-Triangle is the triangle-light;
-intersection is the center of the unit sphere;
-I implemented the operators - and * (cross-product) and dotproduct (inner product) for points and they seem to be correct, as I use them a lot in other parts of the raytracer and there are no problems there;
-area is the resulting value.

What am I doing wrong?

CGTalk Moderation

01-17-2006, 07:00 AM

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.

Follow Us On:

The CGSociety

The CGSociety is the most respected and accessible global organization for creative digital artists. The CGS supports artists at every level by offering a range of services to connect, inform, educate and promote digital artists worldwide. More about us