how to get the pixel coordinate of a collision ?

BlitzPlus Forums/BlitzPlus Beginners Area/how to get the pixel coordinate of a collision ?

supply(Posted 2005) [#1]
Hi all,

For example, I can use ImagesCollide to test the two-objects collision event, it works really well.
But I am wondering how can I get the exact pixel coordinate of the collision point ?
I thought about this, but still have no idea. Is there any simple to do this ? Thanks

supply


WolRon(Posted 2005) [#2]
Well, first off, there may be more than one pixel involved in the collision. So what you really need to decide is which pixel are you looking for?

If it's any pixel, or all of them, then just write your own imagescollide function that keeps track of which pixels overlap.


daaan(Posted 2005) [#3]
I too am in need of this. Anyone?


supply(Posted 2005) [#4]
Hi, I would like to address my problem more specifically.

I guess ImagesCollide() works is because it tests all the non-transparent pixel to see if there is an overlap between two images.
So if ImagesCollide() can detect this, it should be easily able to return the value of the coordinate of the overlapping pixels.
Certainly B+ did not provide this function, but it really nice if it can be done in new version.
I know in principle how to build up my own collision detection function. But I could imagine it will works much slow than ImagesCollide() because I think ImagesCollide() is best optimized.
I would like to perform multi-collision and reflection between objects, that's why I would like to know the pixel coordinate to determine cases. Is this a hard problem beyond a beginner ?

supply