Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Computer Forums > Software Programming
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

Software Programming Software programming talk, ask questions about computer software programming or help others

Google
Closed Thread
 
LinkBack Thread Tools Display Modes
Old 06-12-2007, 11:29 PM   #1
T
 
T's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Accurate collision detection ??

Hi,

I am working on a breakout clone and I am a bit stuck on how to efficiently
code up collision detection.

I have a simple algorithm that detects collisions between rectangles so I
can tell if the ball has hit a brick. The problem is I am not sure how to
do the calculations to determine where on the brick the ball hit, so I can
then do the appropriate collision response. For example if the ball hits
the horizontal edge of a brick then its y-axis velocity should be changed,
and if the ball hits the vertical edge of a brick then its x-axis velocity
should be changed.

The only thing I can think of is to create a line that represents the
trajectory of the ball and then check against each surface of the brick to
see if it intersects. I can reduce the number of surfaces to check on the
brick by looking at the direction the ball of travelling eg. if the ball is
travelling toward the top-left of the screen then I only need to check the
bottom horizontal surface and the right vertical surface of the brick. Is
there a simpler/smarter way to do this?

Anyone know of a good reference site that talks about this?

At a later stage I would like to add rotation to the ball, but for now I
just want to get something simple running.


Thanks
Ty


 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Old 06-12-2007, 11:31 PM   #2
Peter B
 
Peter B's Avatar
 
Posts: n/a
My Photos: (0)

Banked:
MK Cash: $

I am Worth:
MK Cash: $
Donate

Recent Blog: None

Default Equations for collisions of circular objects

Ty - You probably already have a solution, but I found this article.
http://www.mvps.org/directx/articles...ng_spheres.htm
on collision detection for spheres

To Newsgroup Games.programming
I am a curler ( a Canadian game ) which has similar collisions to pool table
ball to ball collisions.
Whenever I watch or participate in curling, I think that judgment skills
could be enhanced by a better understanding of the collision physics
involved. (both planned offset and sweeping judgment skills - plan b shots,
etc)
Being an engineer, I start thinking about programming a collision simulator
but am rusty on my circular collision equations.
I was hoping that someone from this newsgroup could point me in the right
direction to get started on .circular collision equations.
I need
a) equations for
- simple circular collisions
- more complex rotation collisions to account for direction
changes due to spin
- very advanced - to take ice interaction into account.
Objective:
Set up on overhead view of house - the area where the collisions occur
Populate with rocks ( maybe in future marry a TV frame grabber and verify
simulation with actual shots)
Show the possible outcomes of initial rock collision for
a) plus/minus angle windows for next collision
b) translate that into the horizontal offset view
c) duplicate for multiple collisions
Regards
Peter



===========
"T" <csaweb@ozemail.com.au> wrote in message
news:va2Jb.73413$aT.66309@news-server.bigpond.net.au...
> Hi,
>
> I am working on a breakout clone and I am a bit stuck on how to

efficiently
> code up collision detection.
>
> I have a simple algorithm that detects collisions between rectangles so I
> can tell if the ball has hit a brick. The problem is I am not sure how to
> do the calculations to determine where on the brick the ball hit, so I can
> then do the appropriate collision response. For example if the ball hits
> the horizontal edge of a brick then its y-axis velocity should be changed,
> and if the ball hits the vertical edge of a brick then its x-axis velocity
> should be changed.
>
> The only thing I can think of is to create a line that represents the
> trajectory of the ball and then check against each surface of the brick to
> see if it intersects. I can reduce the number of surfaces to check on the
> brick by looking at the direction the ball of travelling eg. if the ball

is
> travelling toward the top-left of the screen then I only need to check the
> bottom horizontal surface and the right vertical surface of the brick. Is
> there a simpler/smarter way to do this?
>
> Anyone know of a good reference site that talks about this?
>
> At a later stage I would like to add rotation to the ball, but for now I
> just want to get something simple running.
>
>
> Thanks
> Ty
>
>



 
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Featured Websites
Free Space
Free Space
Free Space Free Space
Closed Thread
Tags: , ,




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How accurate is my speed? David Steward GPS 43 06-25-2007 11:54 PM
Accurate colors vladimirestragon Graphics in general 1 06-11-2007 7:19 PM
HELP! I'm locked out of XP because of a chasis intrusion detection Gazwad Windows 2 06-11-2007 5:23 PM
recommend an intrusion detection system Dica Website Reviews And Website Questions 1 05-28-2007 12:07 AM


Featured Websites




All times are GMT +1. The time now is 12:47 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98