yoyoman2
|
  |
| Joined: 07 Mar 2009 |
| Total Posts: 2170 |
|
|
| 03 Nov 2013 12:54 AM |
I am currently making a wind simulator, and need some help with geometry in 3D. I did not learn this stuff in school, because Its suppose to be first year in university or something.
anyways, I have 4 Lines that are parallel to each other and are the same length, I make planes on all 8 points of the lines.
How do I find out that a certain point in space is inside that object.
If it will be easier for you guys, I can make it a 3D rectangel.
I you will not help me make it, which is totally ok for me, can you just direct me to some source so I can learn this stuff? |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2013 12:55 AM |
| "4 lines" "the same length" kk |
|
|
| Report Abuse |
|
|
yoyoman2
|
  |
| Joined: 07 Mar 2009 |
| Total Posts: 2170 |
|
|
| 03 Nov 2013 12:57 AM |
yes, If you are un aware that a line can be described as all the points between two dots.
It can also be described as a dot and a direction, but that would make it infinite, would it not? |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2013 01:01 AM |
In Geometry, all lines are infinite. We call a line between 2 dots as a line segment. Anyways, to find out if a point is in the rectangle, well...
if (rect.x0 < dot.x and dot.x < rect.x1 and rect.y0 < dot.y and dot.y < rect.y1) then print("Is in the box"); end |
|
|
| Report Abuse |
|
|
yoyoman2
|
  |
| Joined: 07 Mar 2009 |
| Total Posts: 2170 |
|
|
| 03 Nov 2013 01:02 AM |
this is where my problem comes.
I never said that my rectangle was not rotated. |
|
|
| Report Abuse |
|
|
XAXA
|
  |
| Joined: 10 Aug 2008 |
| Total Posts: 6315 |
|
|
| 03 Nov 2013 01:13 AM |
| Cast a ray from the point towards the center of the rectangle. If it intersects only one line, then it's inside the rectangle. |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2013 01:20 AM |
| Xaxa, I was about to say that too. |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2013 05:25 AM |
| You could use Vector3's :IsClose() method. |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2013 06:52 AM |
| SCP, he wants the algorithm itself... I think? |
|
|
| Report Abuse |
|
|
|
| 03 Nov 2013 08:27 AM |
@AndroidKitKat
Stop trying to sound smart you knew what he meant -.- |
|
|
| Report Abuse |
|
|
| |
|