469,345 Members | 6,515 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,345 developers. It's quick & easy.

Examples using Region and/or Region.Intersect?

Hello all,

Anyone got links to some examples of using Region and/or
Region.Intersect in a graphical / gaming enviroment?

Am investigating into using it for hit-lines in my game.

Brian
Nov 16 '05 #1
3 5679
Hello Brian,

If your game is 2D, or at least you hit-test 2D projections, you can create
regions for two entities you are going to check for a collision and then
intersect these regions. Then check whether the resultant region is
non-empty and if it is, you've got the collision, otherwise there was no
collision.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"Brian" <br************@gmail.com> wrote in message
news:c2************************@posting.google.com ...
Hello all,

Anyone got links to some examples of using Region and/or
Region.Intersect in a graphical / gaming enviroment?

Am investigating into using it for hit-lines in my game.

Brian


Nov 16 '05 #2
Thanks for the advice but i've really no idea of creating Regions etc.

That's why i'm looking for examples.

My hitlines up until now have been 6 lines (each with a StartPoint and
EndPoint) - 2 hitlines each side of the table, and 2 on top and bottom
(the reason i've the 2 is to leave a space for the goal) like so:
_ _
|_ _|

Tough to visualise, i know!

Should i use a GraphicsPath and add all the Start and End Points?

I'm really puzzled.. anyone shed some light on this or point me toward
some examples?

Brian

Nov 16 '05 #3
Thanks for the advice but i've really no idea of creating Regions etc.

That's why i'm looking for examples.

My hitlines up until now have been 6 lines (each with a StartPoint and
EndPoint) - 2 hitlines each side of the table, and 2 on top and bottom
(the reason i've the 2 is to leave a space for the goal) like so:
_ _
|_ _|

Tough to visualise, i know!

Should i use a GraphicsPath and add all the Start and End Points?

I'm really puzzled.. anyone shed some light on this or point me toward
some examples?

Brian

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Brian Basquille | last post: by
3 posts views Thread by prathamesh.deshpande | last post: by
1 post views Thread by =?Utf-8?B?TWl0Y2hX?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.