Page 2 of 2

Re: Overllaping matrices

Posted: Fri Aug 23, 2013 7:57 am
by chezrom
Your code do in fact an intersection of two sorted arrays, ie produces an array with the common values.
intersect([1,2,3,4],[2,4,6])=[2,4]

For me, a matrix is a 2D arrays, and I must admit that I don't know what is a "matrix intersection"

EDIT : Oups, vrld is faster than me

Re: Overllaping matrices

Posted: Fri Aug 23, 2013 1:51 pm
by Ranguna259
Ref wrote:
Ranguna259 wrote: BTW, rectangle intersection is not an easy thing to do, that's why there's always a code on most programing languages to do that for you but there isn't one in löve.
Is this where you are heading?
Oh god yes, once the lib is out I'm gonna ask you for some help ;)

Re: Overllaping matrices

Posted: Sat Aug 24, 2013 6:29 pm
by LuaWeaver
What he wants is not just a "matrix" intersection, he wants "world" intersection, where each tile region is represented in a matrix. He wants to find the intersection, given the "position" of the matrices, relative to another.

I think.

Re: Overllaping matrices

Posted: Fri Nov 08, 2013 4:25 am
by tetsuken
Guys sorry for the late answer, i'm a seafare worker so sometimes i go on ship and when i come back 1 month or more has passed.

Anyway, thats was a very hot topic i fought it could be and i apreciate all answers. VRLD i dont want an intersection of matrix only to know the numbers of the matrix, think about that, if the matrices has intersection they have number in comon and this mean value so that means a "true" statement so i will know that tha matrix can not go on the place it was intended to go, so roll again for a new place until i found a place for the matrix(room) that is not over any of other rooms on the dungeon level.
By the way this is not one kind of dream idea, i alreade implemented that on unity 3d to make my random generator dungeon level, i was looking for some comand helps because on the c# i can handle 2darrays and that make things easy to do. In love2d/lua was a bit trick found a code to make a 2d array from a normal array( in this case table). Thas way i was looking for some guys seniors then me on lua for help :D.
Of course i still didnt know how to make this intersection function on lua, if any one Know i will apreciate.

P.S.: i think this topic is very interesting on the comunity, that would help ppl to make procedural levels on their games.