Search found 4 matches

by haatveit88
Sun Oct 28, 2018 3:57 pm
Forum: Support and Development
Topic: Generating collision boxes based on images with transparency?
Replies: 8
Views: 7248

Re: Generating collision boxes based on images with transparency?

Is it really necessary to generate a collision box? In my game I just do this: r, g, b, a = image:getPixel(xx, yy) if a > 0 then return true, xx, yy else return false, xx, yy end I guess I could set up points along the player shape perimeter, and test those points to see if they are overlapping wit...
by haatveit88
Sat Oct 27, 2018 3:15 pm
Forum: Support and Development
Topic: Generating collision boxes based on images with transparency?
Replies: 8
Views: 7248

Re: Generating collision boxes based on images with transparency?

I think you are going to be in trouble if you expect an algorithm to produce exactly the behavior and physics that you want based on an image. It could work for very simple shapes but I wouldn't expect anything too sophisticated. I guess the big frustration trying to research this is that it works ...
by haatveit88
Thu Oct 25, 2018 4:36 pm
Forum: Support and Development
Topic: Generating collision boxes based on images with transparency?
Replies: 8
Views: 7248

Re: Generating collision boxes based on images with transparency?

Cheers for the response, After reading about triangulation and the limits of the Box2D engine, it seems like Constrained Delaunay triangulation is what I'm looking for. Basically I need to create a set of points based on the alpha channel of the input image, triangulate the result, and then perhaps ...
by haatveit88
Thu Oct 25, 2018 11:37 am
Forum: Support and Development
Topic: Generating collision boxes based on images with transparency?
Replies: 8
Views: 7248

Generating collision boxes based on images with transparency?

Hi! I'm considering migrating my project to Love2D, and as part of evaluating it, I'm trying to find out if there's any built-in (doesn't look like it) or community library that supports generating collision meshes based on an image using its transparency. This could be used to auto-gen a collision ...