Collisions Question

Previous topic - Next topic

Kyo

Hi Guys!
I want to give you a few questions on collisions!

there is a function to calculate the collision between two triangles??


there is a function to calculate the collision between two rotated rectangles?


and if I want to use the shape collisions?


Thanks for help!

Moru

Short answer: No.

Long(er) answer: Depends on what you want to do :-)

You could draw the objects on a sprite and then do pixel perfect collision detection on the sprites.

Kyo

Quote from: Moru on 2014-Sep-23
Short answer: No.

Long(er) answer: Depends on what you want to do :-)

You could draw the objects on a sprite and then do pixel perfect collision detection on the sprites.

I don't want to use the pixel perfect collision because it's slow on big images!
The best way is definitely the shape collisions, so if anyone can help me with the code I would be grateful  :nw:


mentalthink

Hi Kyo in my game I use circles and box collision(without rotating), because you can do any collision with this 2 shapes or aproximate to any shape.

I did an Collision Editor and if I want an especific collision I paint them.

If you need more help about this comment me, I think I have the code well ordened and not problem to give you.

Kyo

Quote from: mentalthink on 2014-Sep-23
Hi Kyo in my game I use circles and box collision(without rotating), because you can do any collision with this 2 shapes or aproximate to any shape.

I did an Collision Editor and if I want an especific collision I paint them.

If you need more help about this comment me, I think I have the code well ordened and not problem to give you.

For  circles and box collision(without rotating) I have no problem.
But for isometric game I have to use or box with rotation or shape zone.

Quote from: Moru on 2014-Sep-23
Have a try with these:
http://gamedevelopment.tutsplus.com/tutorials/collision-detection-using-the-separating-axis-theorem--gamedev-169
http://www.wildbunny.co.uk/blog/2011/04/20/collision-detection-for-dummies/

Thanks, now I study this!  :good:


matchy


Kyo


MrPlow

#8
Also for isometric there is a mathematical calc from ortho top down (cartesian) to iso and collisions could be calculated before the math that would translate the objects to the screen as isometric.

That way you could not need funny angles...
:P

//Cartesian to isometric:

isoX = cartX - cartY;
isoY = (cartX + cartY) / 2;

So do collision based on cartX cartY and draw using isoX isoY
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Kitty Hello

Search for tritri collision. I have such a function. Somewhere...

Gesendet von meinem GT-N7100 mit Tapatalk


Kyo

Quote from: Kitty Hello on 2014-Sep-24
Search for tritri collision. I have such a function. Somewhere...

Gesendet von meinem GT-N7100 mit Tapatalk



In gl_b forum I can't find ...
sure that the name is tritri collision?

Moru

There was something, I think it was in the showcase that could load polygons and maybe collisions. Could it be this one?
http://www.glbasic.com/showroom.php?site=games&game=AC3DPoly

I guess tritri means triangle - triangle collision.