General Category > General Anim8or Forum

WEEHEEEE oh, oh wait its dead, I thought it was dancing (CRE8OR NOTICE)

<< < (39/58) > >>

Thanos:

--- Quote from: cooldude234 on February 24, 2013, 01:18:00 pm ---What do you mean input to test? Like compiled code, like an exe?

--- End quote ---

No, no... just a test case that produces wrong results, for example something like, triangle points: (0,0,0), (5,0,0), (0,0,5) line: (1,-1,1), (1,1,1). I can put your input in the debugger and see where it stops working correctly.

cooldude234:
well I have the vertices of the two triangles at

--- Quote ---   Vertex1.x = 0;
   Vertex1.y = 0;
   Vertex1.z = 0;

   Vertex2.x = 6;
   Vertex2.y = 0;
   Vertex2.z = 0;

   Vertex3.x = 6.3;
   Vertex3.y = 9.1;
   Vertex3.z = 5;

   Vertex12.x = 5;
   Vertex12.y = 0;
   Vertex12.z = 0;

   Vertex22.x = 0;
   Vertex22.y = 0;
   Vertex22.z = 0;

   Vertex32.x = 5;
   Vertex32.y = 0;
   Vertex32.z = -5;
--- End quote ---

It's failing (like I said earlier) near vertices, it works if your dead on with the triangle but not if your close to the vertices.

EDIT: I would suspect floating point inaccuracies could be the cause, but with the size the each triangle, and considering the precision of a 32 bit floating point (which can store up to 7 digits after the decimal) this cannot be the case.

Thanos:
Oh, oh I found the bug. I'll post a new version once I fix it. Thanks for the input, it helped.

(If you're curious, rti3 code was made to work only with equilateral triangles... [What on earth was I thinking?] Anyway, I'll have news soon.)

Thanos:
Ok, fixed...
cooldude234, I PM'd you with your fixed code.  :)

For the rest, rti v4 is attached below.

(Work this time... plz...  ;D)

cooldude234:
okay a bunch of stuff has been changed as I can see.
Just a couple of questions, I might do some debugging my self to get another view point on this,
but which is the faster method for getting the plane collision?
Also what method are you using (I really don't understand any the code too much), is it this method you are using?
http://geomalgorithms.com/a06-_intersect-2.html

Right now I'm trying to figure out how a, b and c are being represented as the plane, because the math that you used to make the plane defined by the triangle is exactly the same as the code I used for finding the normal of the triangle (by getting the cross-product). But you cannot have a plane with the normal, you need a point as well to define the position (I use the first vertices read because its quick and easy, it doesn't matter which it is anyways).

But none the less thanks for the code, once I figure out what numbers need to be used, I'll get it in my code and test it out, hopefully it will work.


--- Quote from: Thanos on February 27, 2013, 07:47:58 am ---If you're curious, rti3 code was made to work only with equilateral triangles... [What on earth was I thinking?]
--- End quote ---
LOL, yea I don't ever think a equilateral only collision algorithm is going to be useful to me :P

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version