Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [UNSOLVED] Detecting Collision between a polygon and a circle? PRECISE  (Read 873 times)
0 Members and 1 Guest are viewing this topic.
Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Posted 2012-12-11 22:19:14 »

I have posted this before but what the results were are not as accurate as I need them to be. I have two images
A snow ball,
Circle centered in a square image
And a character

thats not my exact character but something like that.

Now I need precise detection between the two. I cant just detect if the two images hit each other beacause the character does not always hit the edge of the image therefore making that type of detection inaccurate.

Im really confused....how do i do this?Huh

Offline cheatsguy

Junior Member


Medals: 3


Gamer turned Pixel Artist turned Programmer


« Reply #1 - Posted 2012-12-11 22:35:17 »

You'll want to use pixel perfect collision if it absolutely HAS to be perfect, but a square will likely work just as well if you have a character with proportions similar to that, just make the actual radius of the snowball smaller than the image or make it have a delay before disappearing/falling apart

Busy between school, work, life, games, programming and general screwing around.
If you'd like some pixel art for your game, send me a PM, i'll see what I can do.
Current project: http://elementalwarblog.wordpress.com/
Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #2 - Posted 2012-12-11 22:44:07 »

the detection has to be pixel perfect. the images dont fill the square enough to make it work otherwise.. how would i implement sometihng like this

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mac70
« Reply #3 - Posted 2012-12-11 23:58:21 »

What graphics library do you use? I can give you answer for LWJGL.

Check out my Devblog! Smiley
Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #4 - Posted 2012-12-12 00:02:21 »

im coding eveything myself for an android app no lwjgl Sad

Offline Abuse

JGO Knight


Medals: 12


falling into the abyss of reality


« Reply #5 - Posted 2012-12-12 00:50:45 »

Is the polygon (character), or circle (snowball) moving?

If so, for precise collision detect you'll need to consider the collision as a swept circle <-> polygon interaction.

Google points me to this: http://www.three14.demon.nl/sweptellipsoid/SweptEllipsoid.pdf

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #6 - Posted 2012-12-12 01:20:41 »

both objects are moving... and that website looks a little too complex for my understanding

Offline cheatsguy

Junior Member


Medals: 3


Gamer turned Pixel Artist turned Programmer


« Reply #7 - Posted 2012-12-12 02:55:45 »

Just thought of this, perhaps you could make something similar to hitboxes used in 3D games to fit without needing the headache that is pixel-perfect and speed up the whole process. No clue how to do this though :/

Busy between school, work, life, games, programming and general screwing around.
If you'd like some pixel art for your game, send me a PM, i'll see what I can do.
Current project: http://elementalwarblog.wordpress.com/
Offline wreed12345

JGO Knight


Medals: 24
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #8 - Posted 2012-12-12 03:28:25 »

I'm not sure what you mean, but write now I have a detection of when the two images close, although it is not as accurate as I need it to be:(

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (16 views)
2014-08-28 18:26:30

CopyableCougar4 (25 views)
2014-08-22 19:31:30

atombrot (38 views)
2014-08-19 09:29:53

Tekkerue (34 views)
2014-08-16 06:45:27

Tekkerue (32 views)
2014-08-16 06:22:17

Tekkerue (20 views)
2014-08-16 06:20:21

Tekkerue (31 views)
2014-08-16 06:12:11

Rayexar (66 views)
2014-08-11 02:49:23

BurntPizza (44 views)
2014-08-09 21:09:32

BurntPizza (34 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!