World tracking - reset placement


#1

Hey there, I’ve been playing with world tracking and it’s looking great! Awesome work.

I’ve had a play around with trying to ‘reset’ the world placement so you can change where the object is placed, but with no luck so far. (Trying to change the state of the Ground Placement subsymbol on a pointerdown script - not sure if that’s the right way)

At the moment, I’m recanning the zapcode to put my objects somewhere else.

Is there something obvious I’ve missed in order to make a button which resets to the placement stage?


#2

There are a few things I would like to change as well. Like the place button and help. Also it needs to at landscape and portrait mode enabled.

Steve


#3

Hi both,

These are good questions :slight_smile: We’ll add a reset button as an option for the symbol. Note that you can customise the buttons (and the mechanics of the experience itself) by double clicking on the World Tracking Ground Placement subsymbol in the Symbol Definitions list on the right. It’s a wee bit complex in there so we’ll try to simplify that going forward.

Cheers,
Connell


#4

Awesome, those additions would be great.

I did manage to create a sort of landscape mode by rotating the buttons, but the animation ended up a little whack… :joy: So I’m looking forward to a legit landscape mode!


#5

Hi Connell,

best of all would be having a controller able to rotate and translate the tracked object locked to the detected plane, and a way to enable and disable that controller. (I am trying to do something similar)

in any case, Zappar/ZapStudio is IMPRESSIVE. Great job.


#6

Hi, how can I reset world tracking ground placement the right way? You mentioned in subsymbol, but how? I can write some function to call it.
ps. When I tried just activating Install state again on “tap” of some button, the behaviour it is not perfectly same as if you lunch experience with scanning of code, it is not locked well to ground, placed objest is moving somehow little with camera.


#7

Hi @interactive,

The world tracking subsymbol goes through multiple states before the model is placed on the ground. These are as followed:

Initial

If the device doesn’t support world tracking, default to a gyro version where the model will be placed in a 360 environment.

Install

If the device (Android) doesn’t have ARCore installed, ask the user to install it from the Google Play store.
iOS automatically has ARKit installed.

User move

World tracking plane detection is turned on and the user is prompted to move the device to detect a ground plane based on the world around them.

Placement

A content placement state is then initiated which uses hit testing (a raycaster coming from the device’s screen working out where it is intersecting with the ground plane) to position an anchor on the detected ground. The content becomes relative to this anchor.

Normal

The world tracking plane detection is turned off and the anchor and content are set in that position.


If you want to reposition the content, you need to re-activate the placement state. This can be done from the parent symbol in a script, like so:

symbol.nodes.World_TrackingGroundPlacement.controllers.states.elements.Placement.activate();

Just add the above into an event.

Hope this helps.

George


#8

Thank you!

So what state do I call in case if I want to “start” ground placement for the first time from the button, not directly on load?

What I am building:
I have menu and when I select 3D model, then I can place it.
Then for example, after first placement I can go back to menu and change 3D object and place it…(different 3D object selected, my second ground placement from the moment of load of experience).

So if I understand correctly:
I have to check if im am placing the first time I call INITIAL state, and then if I change 3D model I just call PLACEMENT state?

Thank you again :slight_smile:
Nejc


#9

Hi Nejc,

The world tracking ground placements Install state is set up to run on the symbol show event. This is run on launch if you have the subsymbol in the Hierarchy. You can see this in the World Tracker script.

image

You can comment out line 6, meaning that the install state will never activate on show.

image

Using what was explained before, you now activate the Install state from within the subsymbol in the parent at anytime.

For example, if you wanted to activate the world tracking subsymbol on a button tap, you can add symbol.nodes.World_TrackingGroundPlacement.controllers.states.elements.Install.activate(); to a pointerdown event.

Hope this helps.

George