home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TCE Demo 2
/
TCE_DEMO_CD2.iso
/
demo_cd_.2
/
mags
/
stosser
/
stoser08.arj
/
stoser08.msa
/
ISSUE_8
/
32.PNE
< prev
next >
Wrap
Text File
|
1987-04-22
|
2KB
|
65 lines
STOS 3-D Part 5 Matthew Green
Today's lesson is all about ways of programming collisions in STOS
3-D.
I use two methods of detecting collisions :
1) Use the TD Zone command that is just like using the zone
command in normal STOS.
2) Or you could use the TD Range command for the detection
of collisions.
Any of the two methods above are ok to use. The second one is best
used with a small amount of objects, because it is very easy to use.
We shall tackle the difficult one first.
Setting Zones.
--------------
You first have to set the zone, remember that the zone if not square like
it is using the normal STOS command. It is a sphere (e.g. football shape)
You can set the zones using a line like :
100 TD SET ZONE n,zone,x,y,z,r
n = the object number
x,y,z = the centre of the zone.(normally the same co-ordinates as the object)
zone = the zone number, 0,1,2,3....up to 20
r = the radius of the sphere(you can find out there radius of an object
when you are in the O.M)
To detect weather two zones have hit each there are two ways of doing it :
200 H=TD COLLIDE(n1,n2)
This checks to see if object 1(n1) has hit object 2(n2). if it has then H = n2
other wise H = -1
Or you can do this :
200 H=TD COLLIDE(n)
This checks to see if any objects have hit object (n) if they have then H= the
number of the object that hit it. Other wise H = -1
The other method of detection which could work well with your program
is if you use the RANGE command. e.g.
100 if td RANGE(n1,n2)<500 then boom : END
This checks to see wether object 1(n1) is less than 500 units away from
object2(n2). If it is the program ends. But you could have it do anything.
So that is two methods of collision, you should be able to add this to
your progams to make them even better.
Remember if you have any problems you can write to me , my address is in
the contax and i will try and answer you questions.
Until next time......