Originally posted by Bobboau
I've made an update to the exe and the sorce files, I seem to have made it a tiny bit more stable, to the point that I should be able to start fixing the actual unworking code (so it makes the right data for the decals), I havn't actualy crashed with this build, but that doesn't mean it would be a herculean effort to do so
I reiterate my request for some math to find if a line (defined by two points) will intersect a poly (defined by three or four coplaner points), maybe I should ask the general forum were CP would be likely to see it.
you mean something in the order of this.
by thought of how i would design it to check.
fake math (TEXT)
on a 4 coplanar point polygon
x1,x2,x3,x4 & y1,y2,y3,y4 and z1,z2,z3,z4
and our two point line in 3 diemensonal world
px1,px2 & py1, py2 & pz1, pz2
create a boundrie box of the 4 coplanar point polygon.
determine if our two point line will ever touch this box, i will spare you the hows and dont of how this is done, i presume you have basic knowledge of mathimathical equations.
but simply test our two point line´s funtion of fx()=ax+by+c against the coordinates of the bounderie boxes edges.
if it does not ever intersect meaning your result will be NULL
then skip the next and dont check for more.(this will increase performance because the next cheking is system time exspensive.
if so then enter precise cheking function of exactly where it touches our polygon.
where it should check the edges of the polygon, that are converted to functions like fx()=ax+by+c and are set to be tested against each other.
should you at any time get a NULL result because it can easely enter the boundery box, but still miss the polygon, then skip further checking to save performance.
finally you will get the exact coordinate of where your two point line will intersect with the polygon.
if you are not sure on how to do these mathimatical equations, then grab a math book becuase this is not easely explained.
it has been a long long time since i did this kind of math, when i was attending business college. and man am i rusty.
but if you like, i could try and write/test some code for it.