Java-Gaming.org Hi !
 Featured games (88) games approved by the League of Dukes Games in Showcase (681) Games in Android Showcase (196) games submitted by our members Games in WIP (744) games currently in development
 News: Read the Java Gaming Resources, or peek at the official Java tutorials
Pages: [1]
 ignore  |  Print
 Collision detection with trochoids  (Read 1045 times) 0 Members and 1 Guest are viewing this topic.
trvcic

Senior Newbie

 « Posted 2013-01-24 06:42:30 »

I'm trying to do some really slick collision detection with pictures. Please try to follow my logic, it's not that clear, sorry.  I want an image to bounce off the edge of the window, perfectly. Also, I want to understand how it does it, so I can later make 2 images interact.

basically, i realized all pictures are rectangles, and all a rectangle is is 4 points(or 4 lines).
If a rectangle is spinning, the corners move in a circle.
If a spinning rectangle is also moving it forms a trochoid(http://en.wikipedia.org/wiki/Trochoid)

I still need to figure out the equation for a trochoid moving in 2D, but once I do, collisions will be easy. just solve the equation for x or y, and set the other to a known value
(example: if the x of a point is greater than the boundary, y = f(x) and x = the boundary)

If anyone can point me in the right direction I would greatly appreciate it.

while(true) { be awesome; }
HeroesGraveDev

JGO Kernel

Medals: 376
Projects: 11
Exp: 3 years

┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻

 « Reply #1 - Posted 2013-01-24 07:09:39 »

You're overcomplicating things.

Just do an OBB collision check.

trvcic

Senior Newbie

 « Reply #2 - Posted 2013-01-24 14:52:39 »

It's more about the collision response, I did basically an OBB check with out realizing it

while(true) { be awesome; }
Pages: [1]
 ignore  |  Print

You cannot reply to this message, because it is very, very old.

 CopyableCougar4 (41 views) 2016-06-25 16:56:52 Hydroque (77 views) 2016-06-22 02:17:53 SwampChicken (78 views) 2016-06-20 13:22:57 SwampChicken (78 views) 2016-06-20 13:22:49 SwampChicken (73 views) 2016-06-20 13:22:26 Hydroque (116 views) 2016-06-15 08:22:50 Hydroque (108 views) 2016-06-13 06:40:55 DarkCart (231 views) 2016-05-29 02:30:33 Hydroque (192 views) 2016-05-26 14:45:46 Mac70 (182 views) 2016-05-24 21:16:33
 Spasi 49x theagentd 45x NegativeZero 39x KaiHH 28x LiquidNitrogen 23x princec 19x CoDi^R 15x kingroka123 15x ags1 14x ra4king 13x Opiop 10x purenickery 9x Hydroque 9x Archive 8x SHC 7x czak 7x
 Making a Dynamic Plugin Systemby Hydroque2016-06-25 00:13:25Java Data structures2016-06-13 21:22:09Java Data structures2016-06-13 21:20:42FPS Camera Tutorialby Hydroque2016-05-22 05:40:58Website offering 3D Models specifically for games for freeby vusman2016-05-18 17:23:09Website offering 3D Models specifically for games for freeby vusman2016-05-09 08:50:56Website offering 3D Models specifically for games for freeby vusman2016-05-06 11:10:21Website offering 3D Models specifically for games for freeby vusman2016-04-29 12:56:17
 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