
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
"Kolja Sulimma" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Let the cube be given by three normal vectors n1 to n3 and six points > p1 to p6 on the six planes. > (Actually you can use the same point multiple times) > Assume your rays start in the origin and are given by a vector r of > length 1. > Then the interscetions with the first plane happens at a distance d of > d1= n.p1/(n1.r)= n.p1 * (1/(n1.r)) > See http://geometryalgorithms.com/Archive/algorithm_0104/algorithm_0104B.htm#Line-Plane%20Intersection > Then you order the planes according to d. > If the ray does not cross the three front planes first, the cube is > missed, otherwise the difference between the fourth and the third > distance is the length of the intersection. > > So for each ray you get three devisions, four multiplications and a > couple of minmax cells. > (Many ore optimizations due to symmetries possible.) > > With integers you should be able to do that in a small Spartan-III in > a pipeline a lot faster than you can get data into the chip. > > With floating point numbers it should be still very fast in an FPGA, > but the design gets a lot more complicated and larger. > > Have fun, > > Kolja Sulimma Thanks a lot, Koja, Very informative,,... I need to digest your answer... -Walala
| <-- __Chronological__ --> | <-- __Thread__ --> |