POV-Ray : Newsgroups : povray.off-topic : Math question (inside box) : Re: Math question (inside box) Server Time
28 Jul 2024 22:24:31 EDT (-0400)
  Re: Math question (inside box)  
From: Patrick Elliott
Date: 6 Aug 2013 00:11:20
Message: <52007768$1@news.povray.org>
On 8/5/2013 4:38 AM, scott wrote:
> There are much easier, well documented, ways for doing bounding box
> tests, you don't need to go into splitting it up to squares and
> triangles and measuring areas as you seem to have done. If that's what
> you want to do?
>
Yeah, basically. What I searched google for was, basically, "Find if 
point is in a box". And, well, adding "in 3D" didn't seem to help much. 
lol I completely forgot to search on "bounding box". :p

My actual theory here though, if its more understandable, was like.. If 
you had an aquarium, which you could look into, from any two sides, and 
a 90 degree angle from each other, but you couldn't get around to any of 
the other sides, and you needed to "prove" mathematically, that an 
object in it was "actually" in the aquarium, and not outside.

So, logically, you take two sides, that are at 90 degrees from each 
other, than mathematically test of you can "see" the object from those 
two sides, "inside" of the rectangle each side represented.

In principle, this should work. What I screwed up with was that I need 
two sets of calculations. One set is other original, from here (if your 
mouse is in the box, the box turns red):

http://www.emanueleferonato.com/2012/03/09/algorithm-to-determine-if-a-point-is-inside-a-square-with-mathematics-no-hit-test-involved/

Then, completely screwed up, by trying to reuse the same exact 
equations, for both sides (or, rather, the same "components" of the 
vectors).


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.