Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Intersection between models #300249
11/30/09 19:41
11/30/09 19:41
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Hey guys

I wondered if there is any possibility to check wheter two models overlay each other or to check if there is any intersection between two or more models or not.

I want to place buildings in a rts-like game.
i want to check if a certain building can be placed at the desired spot. It's not tilebased though.
it should just check:

"is there a model intersecting with this preview of the model which should be placed
-> yes - you're not able to place the model
-> no - place the model at the desired spot.

Or is there a way to trace with the whole body of a model? I tried several things but the traceray seems always to be smaller than the model i want to place

i hope you're able to help me

Roxas~

Re: Intersection between models [Re: Roxas] #300256
11/30/09 20:53
11/30/09 20:53
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
not exactly what you want but i already had an example for that.

probably this was for teaching something to someone and may be using unnecessary c_trace calls, so there is room for a lot of improvement.

click on an image to build a building, higlight a building and press DEL to delete
press R to rotate while building.f9 toggles debug mode. you cant build on sloppy surface and on other buildings. red means you can not build, green means you can build.

http://depot.acknexturk.com/rtsbuild.rar


3333333333
Re: Intersection between models [Re: Roxas] #300257
11/30/09 21:06
11/30/09 21:06
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
**** double posted due to some little server downtime.

Last edited by Quadraxas; 11/30/09 21:06.

3333333333
Re: Intersection between models [Re: Quad] #300260
11/30/09 21:56
11/30/09 21:56
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
I worked on an rts with eastcoast games that had freeform placement, and all we did is place an invisible marker on each corner of the bounding box (for debugging) and did a check to make sure the new object woudnt be in it at all.

Re: Intersection between models [Re: lostclimate] #300315
12/01/09 14:16
12/01/09 14:16
Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
Roxas Offline OP
Member
Roxas  Offline OP
Member

Joined: Apr 2008
Posts: 144
Germany | Niedersachsen (Lower...
thanks for your answers guys
the little demo from quadraxas helped me a lot, so thank you!

Now it works

greets Roxas~


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1