Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / beta11: tier1: 3d collision question

Author
Message
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 10:05
Hi,

I have a collision problem.
I'll try and explain myself as clearly as possible.
I'm making a 3d tetris game and the collision function I'm using is simple,


It works fine in this example,





But when the two objects are clipping,





it doesn't.

Can anyone help me remedy this? It kind of spoils the game.

Thanks,
miki

in the end
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th May 2013 10:19
did SetObjectCollisionMode( iGround, 1 ) not work for you?
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 10:49
Hi Markus,

Isn't SetObjectCollisionMode() default?

Just tried it anyway and the problem still occurs.

in the end
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th May 2013 10:57
i think about,ohh, i remember its only for the raycast.
I thought it was a complete collision system.

at your problem you can use more raycasts for each block in the object. now you use only 1 middle point.
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 11:03
Quote: "use more raycasts for each block in the object"


Interesting, how do I assign raycasts to each block?

in the end
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th May 2013 11:05 Edited at: 4th May 2013 11:07
the original object position + offset.
with block i mean each sqare/cube in tile.
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 11:11
do you mean like this?
hit1 = ObjectRayCast(0,oldx#+5,oldy#,oldz#,getobjectx(active)+5,getobjecty(active),getobjectz(active))

in the end
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 4th May 2013 12:10
This is again that we are missing a simple box collison command in agk.

You could also simply use sphere cast at the corners of your blocks.
This way do you get collision every time a block overlapps Another one.
With this do i mean you test for a sphere colliosion at all the corners of the Active block and can veary easy detect wath corner is overlapping.
My English is poor but i hope its clear wath i mean

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th May 2013 12:39
yes i mean like this.
also you can use a array and place a abstract 3d world in it.
you can move only to a position thats free.
eaxample:
11000000
01110000
00001100
00001100
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 12:47
Thanks Cliff Mellangard 3DEGS

I just tried


That didn't work.

I'll try your suggestion now...

in the end
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th May 2013 13:27
i mean this by offset, each middle of x is a raycast.
you must know the rotating of the block.
XX
XXX
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 13:51
Hmm!

This could be sorted if there was polygon collision detection.

(Is Wigan listening?)

in the end
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th May 2013 14:14
maybe we get a collision system if the 3d part is finished this year.
working in a array and then visualize it in 3d is much simpler.
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 14:20
Quote: "working in a array and then visualize it in 3d is much simpler."


I'm trying to get my head around it, but finding it difficult conceptually.

Still, what are Saturdays for, eh?

in the end
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 14:54
@ Cliff Mellangard 3DEGS

After trying it out on one block type, your sphere-collision system seems to work,
but it triples (at least) the amount of code needed.
Once again, one has to take rotation into consideration.

I'll continue with the other four block types and keep you posted...

in the end
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th May 2013 16:33 Edited at: 4th May 2013 16:33
just for fun i made a 3d visualisation
see download:

Attachments

Login to view attachments
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 18:12
Quote: "just for fun i made a 3d visualisation
see download:"


Nice!
Very nice!

Now you really ***k** my head!

I'll learn from it.

------------------------------------------------

I'm working on a method based on arrays at the moment.
I'll keep you posted.

Thanks,
miki.


ps.

I once read "there are two kinds of people...
those who succeed...
and those who give up"

in the end
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th May 2013 18:28
the disadvantage with the array is that the smooth moving of blocks in 3d
is very special. but its only moving from one state to another.
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 4th May 2013 18:46
Quote: "the disadvantage with the array is that the smooth moving of blocks in 3d
is very special. but its only moving from one state to another."


I'm attempting to place the raycast in a block of 3x3... 1-9.
Using #5 as the center
And the rotation is in steps of 90 degrees...
The blocks are 5 units each and they move up, down or across in units of 5.
So it shouldn't be so complicated .... (me thinks!!)

in the end
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 4th May 2013 20:44
I can imagine.
miki
19
Years of Service
User Offline
Joined: 7th Jan 2005
Location:
Posted: 5th May 2013 11:34 Edited at: 5th May 2013 11:36
This is what I came up with.
And it works!




Thanks Markus and Cliff.

in the end
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 5th May 2013 12:24
ok cu at showcase

Login to post a reply

Server time is: 2024-11-24 13:30:52
Your offset time is: 2024-11-24 13:30:52