Scolring - Forum

Entraides et échanges autour de la technologie Scol - Informations and exchanges on the Scol technology

Vous pouvez changer la langue de l'interface une fois inscrit - You can change the language once registered

You are not logged in.

#1 9-Jul-2011 17:08:18

gius
Member
Registered: 5-Jun-2011
Posts: 53

AR and collision between two objects

In my game with the markers move object A, if object A collides with object B, object B follows object A in the screen.
Any suggestions where to start?


thanks

Offline

#2 9-Jul-2011 17:58:37

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: AR and collision between two objects

you can try link object B to object A and disable marker 2 on a distance

Offline

#3 9-Jul-2011 19:00:41

gius
Member
Registered: 5-Jun-2011
Posts: 53

Re: AR and collision between two objects

I explained bad, sorry Arkeon.
Object A is moved by the marker, object B is in the background (is not moved by any marker!).
If object A collides with object B, object B follows object A.
The goal is: with the marker is moved the object A and object B follows object A.

How do I link two objects, get object?

thanks

Offline

#4 9-Jul-2011 19:21:14

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: AR and collision between two objects

try the object link plugIT

Offline

#5 9-Jul-2011 19:25:32

gius
Member
Registered: 5-Jun-2011
Posts: 53

Re: AR and collision between two objects

is true, you're right!
But how can I develop: if object A collides with object B?

Offline

#6 9-Jul-2011 19:27:02

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: AR and collision between two objects

with object distance plugIT or physic contact for object with physic enable

Offline

#7 9-Jul-2011 19:36:56

gius
Member
Registered: 5-Jun-2011
Posts: 53

Re: AR and collision between two objects

Now I feel, thanks Arkeon for everything!

Offline

#8 10-Jul-2011 17:30:25

gius
Member
Registered: 5-Jun-2011
Posts: 53

Re: AR and collision between two objects

I have tried:
distance: first object and second object at a distance 0;
link object:  first object and second object

  but as I develop: if object A and object B collide, links object A and object B?

thanks

Offline

#9 10-Jul-2011 17:33:09

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: AR and collision between two objects

distance are from the object origin.
it will be really difficult to have 0 distance between them.
you must set the distance for example as the object radius.

Offline

#10 10-Jul-2011 18:09:49

gius
Member
Registered: 5-Jun-2011
Posts: 53

Re: AR and collision between two objects

I have tried:
distance: first object and second object at a distance 10;
Scene distance int Current distance -> Scene Object link inst Link
link object:  first object and second object

but non work.

The procedure is this?

thanks

Offline

#11 10-Jul-2011 19:19:53

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: AR and collision between two objects

10 equal to 10 meters, you must know the size of your object
and no it's not the current distance but you want to know when the the first object get in the second object radius so you must use "in" event

Offline

#12 10-Jul-2011 19:43:20

gius
Member
Registered: 5-Jun-2011
Posts: 53

Re: AR and collision between two objects

"you must use "in" event"


Enable on init event?

In openspace as I can see the size of the object?

Offline

#13 10-Jul-2011 19:49:52

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: AR and collision between two objects

in the distance plugIT you have 3 events "Current distance" "In" and "Out"
you want to know when your object come in the second object radius, the "In" event come when A come in B radius

In OpenSpace3D the grid is 10 meters long, you can also check with the objects position
set your first object position to 0 and move the second object near the second to know the good distance to apply

Offline

#14 11-Jul-2011 14:40:08

gius
Member
Registered: 5-Jun-2011
Posts: 53

Re: AR and collision between two objects

Now it works fine! Thanks!


But because the second object, when following the first object, becomes much larger?



here screenshots  and all files
http://kktc.jimdo.com/


thanks

Offline

#15 11-Jul-2011 17:48:49

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: AR and collision between two objects

I think this will depend of the object position setted in link plugIT.

Offline

#16 11-Jul-2011 18:22:17

gius
Member
Registered: 5-Jun-2011
Posts: 53

Re: AR and collision between two objects

There is something not working well:
if the object is in the background of the live webcam is a measure,
if the object snaps to the AR, increases in size,
I have tried many things and is always the same thing,




the folder is at this link

http://kktc.jimdo.com/


This is normal?

Last edited by gius (11-Jul-2011 19:56:49)

Offline

#17 11-Jul-2011 22:10:43

arkeon
Admin. / Scol language & OpenSpace3D developer
From: Nantes
Registered: 30-Mar-2009
Posts: 5,161
Website

Re: AR and collision between two objects

First it should be easier for you if you center pivots on objects in sketchup.

Otherwise you can add a "dummy" as a father of your object to position your object to the center of the dummy and then track the dummy against the object.

you also need to enable distance only when marker has been found, otherwise the initial distance is true and the link plugIt is enabled.

to manage the default camera view I added a static camera initialized on application start

here your project corrected : here

(I changed the marker ID with one I had, you will need to reset it to 0)

Offline

Board footer

Powered by FluxBB