473,473 Members | 2,016 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 5839
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: sunaina | last post by:
I am doing the following query using intersect but gives me an error 'error in sql syntax. I tried using join as well but gives me similar error. In the following code still has intersect just to...
1
by: Brian | last post by:
Greetings all, I wrote a message regarding hit-lines here a couple of days back saying: "Anyone got links to some examples of using Region and/or Region.Intersect in a graphical / gaming...
1
by: Brian | last post by:
Hello all. Hope you're all enjoying your Christmas / New Years etc. I know i've asked this before but i am truly at my wit's end, so any help right now would be much appreciated! How do i...
2
by: Brian Basquille | last post by:
Another question for ye all.. How do i check if a Region has entered another region? Up until now, i've been checking if rectangles (or images converted into Rectangles) have been visible in a...
1
by: duzhidian | last post by:
hello all, I only use indexed arrays. When I use array_intersect function, of $a3 = array_intersect( $a1, $a2 ), I just need the vales of intersect array and let keys to be re-numberred...
2
by: ngenius | last post by:
Hello everyone, I am new to MySQL but just realized it does not support INTERSECT in MySQL 5.0 Community Server. I have this problem to solve. (1) cust_table cust_id city_code. ...
3
by: prathamesh.deshpande | last post by:
Hi, I am facing problem while excuting a mysql query. My problem is as follows- I have two tables object_1 and object_2. The structure of object_1 is object_id name address ------------...
3
by: bzb | last post by:
hi ALL, I have a situation to use INTERSECT in my query, but INTERSECT is not supported in "mysql 4.1.15". Can anyone explain me how to tackle this problem..... ! Also, is there...
1
by: =?Utf-8?B?TWl0Y2hX?= | last post by:
Hello, I have the following code: DirectoryInfo pdfDirectory = new DirectoryInfo(@"..\Documents"); var files = from f in pdfDirectory.GetFiles("*.pdf") select new { Filename =...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.