collisions and triangles solved.

Started by davec64, October 29, 2013, 12:38:04 PM

Previous topic - Next topic

davec64

Hi all. I had quite a battle working out what was wrong with my collision shield. Only one triangle was detected by my  pointy object.
Details
Create an array to represent the corners
V1 v2 V3 v4 using v1-v3 create the fist triangle.
Addtriangle to rectangle object.
Change v1 coords to v4
Adddtriangle. To rectangle object.
Add to world
Fails miserably. It gives a perfect rectangle but only the first rectangle registers a collision.
Cause and Solution?
Moving v1 only causes the face to flip.
I found moving v1 to v2 and v2 to v4 addtriangle works a treat.
I assume this stuff is done automatically by 3d packages and those in the know?
Any way hope this helps other newbies.
No code as this is just a technique. If you found this you must have gone down the same path as me.
Davec64
Retro assembly game coder.