BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

simple graphical collisions

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
C. Johansen
Guest





PostPosted: Wed Aug 03, 2005 10:31 am    Post subject: simple graphical collisions Reply with quote




Hi,

I've been programming in delphi for several months now, my
background is c so don't be too harsh. I'm currently trying
to write a simple 2D game and was wondering if delphi has
any libraries to do geometry calculations such as simple
collisions such as those between 2 moving space ships or
a fire-ball.


-Cory



Back to top
C. Johansen
Guest





PostPosted: Wed Aug 03, 2005 12:54 pm    Post subject: Re: simple graphical collisions Reply with quote




Hi Miklos,

I'm also after routines that will give the bounding
polygon of a set of points. does delphi provide that
or do I have to look for other 3rd party libraries
do that too?

-Cory



"Miklós Kiss" <kissmiklos (AT) freemail (DOT) hu> wrote:
Quote:

Hi,

[...] and was wondering if delphi has
any libraries to do geometry calculations such as simple
collisions such as those between 2 moving space ships or
a fire-ball.

Delphi does not have such libraries but You might find 3rd prty
tools to do that. I would give DelphiX a try too: it has sprites
and probably supports sprite-sprite collision checking. I never
used sprites with DelphiX so I don't how to do that. Have a look
at the expamles.

Regards,
MikKi



Back to top
dd
Guest





PostPosted: Wed Aug 03, 2005 1:12 pm    Post subject: Re: simple graphical collisions Reply with quote



C. Johansen wrote:
Quote:
Hi,

I've been programming in delphi for several months now, my
background is c so don't be too harsh. I'm currently trying
to write a simple 2D game and was wondering if delphi has
any libraries to do geometry calculations such as simple
collisions such as those between 2 moving space ships or
a fire-ball.


-Cory


You can use these win32 functions

IntersectRect
PtInRect

PtInRegion
RectInRegion

Look in the win32 help for

"Rectangle Functions"
"Region Functions"

to get more details.

Back to top
C. Johansen
Guest





PostPosted: Wed Aug 03, 2005 1:37 pm    Post subject: Re: simple graphical collisions Reply with quote


Hi dd,

I'm hoping to be able to compile the code with Kylix
and don't I think the routines you provided are
portable because they are native to the windows
platform.

Do you know of any portable geometry libraries
written in delphi that don't rely win32 calls?


-Cory


dd <dd (AT) bogus (DOT) com> wrote:
Quote:

You can use these win32 functions

IntersectRect
PtInRect

PtInRegion
RectInRegion

Look in the win32 help for

"Rectangle Functions"
"Region Functions"

to get more details.




Back to top
Jeremy Darling
Guest





PostPosted: Wed Aug 03, 2005 3:48 pm    Post subject: Re: simple graphical collisions Reply with quote

Since you want to go cross platform, I would suggest trying out GLScene
(http://www.glscene.org) its an OpenGL wrapper for Delphi. You could easily
do 2D or 3D in it and it gives you many advanced functions that arn't
implemented in other component sets. IE: Collision testing in about 5
different types.

Jeremy

"C. Johansen" <cj (AT) mikesnuts (DOT) com> wrote

Quote:

Hi,

I've been programming in delphi for several months now, my
background is c so don't be too harsh. I'm currently trying
to write a simple 2D game and was wondering if delphi has
any libraries to do geometry calculations such as simple
collisions such as those between 2 moving space ships or
a fire-ball.


-Cory






Back to top
Nicholas Sherlock
Guest





PostPosted: Wed Aug 03, 2005 7:36 pm    Post subject: Re: simple graphical collisions Reply with quote

C. Johansen wrote:
Quote:
Hi,

I've been programming in delphi for several months now, my
background is c so don't be too harsh. I'm currently trying
to write a simple 2D game and was wondering if delphi has
any libraries to do geometry calculations such as simple
collisions such as those between 2 moving space ships or
a fire-ball.

FastGeo.

http://www.partow.net/projects/fastgeo/

Cheers,
Nicholas Sherlock

Back to top
Arash Partow
Guest





PostPosted: Wed Aug 03, 2005 7:37 pm    Post subject: Re: simple graphical collisions Reply with quote



1.) With your moving objects you should generalize them
with axis aligned bounding boxes and setup your collision
detection system based on the bounding boxes. to further
reduce the complexity of collision detection (if there
will be many objects on the board) is to implement a spatial
container, and hence only test for collisions between object
that are "near" each other.

2.) The bounding polygon of n points is commonly known
as the "convex hull" of the points, many algorithms exist
today for calculating the convex hull of a set of points,
ie: graham scan, jarvis march, gift wrapper etc...

As far as a library to do these things you can try fastgeo,
its a computational geometry library written in object pascal
(aka Delphi language)

url: http://fastgeo.partow.net


The library is portable on any architecture that supports
minimal Borland object pascal language syntax. It compiles
with Delphi, Kylix and FreePascal, and has only one dependency
namely the Math unit (sin, cos and arctan routines).



Arash Partow
__________________________________________________
Be one who knows what they don't know,
Instead of being one who knows not what they don't know,
Thinking they know everything about all things.
http://www.partow.net




"C. Johansen" <cj (AT) mikesnuts (DOT) com> wrote:
Quote:

Hi,

I've been programming in delphi for several months now, my
background is c so don't be too harsh. I'm currently trying
to write a simple 2D game and was wondering if delphi has
any libraries to do geometry calculations such as simple
collisions such as those between 2 moving space ships or
a fire-ball.


-Cory





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.