Calculation formula...
dapion
Member, PRO Posts: 353
Hi there...
I'm looking a calculation formula for the following problem.
I have two Actors (red, green)
Actor green overlaps Actor red.
I now want to calculate what percentage of the Actor green overlaps the red.
I'm not sure if I can implement or calculate this in GS.
Did any of you have an idea?
Thanks...
Comments
I could do it easily if it didn't matter about diagonal intersection or not, it is possible but would be annoying either way. It's all just math on math on math. If you need me to do it PM me
Yes, it is diagonal calculations.
I also know that it's just math...math and math:-)
The question arises for me ... if that is to act in GS
dapion.de
[https://twitter.com/dapionde?]
i dont think it is possible
as actors do not communicate at which x or y they are collapsing
My Apps
https://itunes.apple.com/de/artist/david-zobrist/id733552276
https://play.google.com/store/apps/developer?id=David+Zobrist&hl=de
I think the Gamesalad game Puzzle Dozer by @gamesmold does something like this, so I think can be done.
you mean this...?
http://forums.gamesalad.com/discussion/74786/zoo-turn-a-twisted-puzzler-by-gamesmold#latest
dapion.de
[https://twitter.com/dapionde?]
this
http://www.gamesmold.com/puzzledozer.php
it already comes close
@gamesmold can you help?
dapion.de
[https://twitter.com/dapionde?]
You could do it with some math for sure. This thread gives a bit more insight here:
http://stackoverflow.com/questions/9324339/how-much-do-two-rectangles-overlap
Follow us: Twitter - Website
Like AlchimiaStudios says, it can certainly be done with maths.
Attached is another - more mechanical - route, just drag the red rectangle around so it overlaps with the blue rectangle.
This is just thrown together to give you the idea, it could be a lot more accurate / better coded, but it gives you the basic idea.
True, but you know the size of each actor, their center positions, and their rotation
@Socks -- what a fun solution! Nice idea.
Cheers, it's a bit brute-force (rather than elegant maths) but it could work with some more thought/refinement, it's a bit crude at the moment.