So far we've looked at creating markers from 2-D images.
Now we're going to move on to 3D objects.
Yes you can make a Mocca out of a 3D object.
Here you can see a part that I created and I'm going to use that to make a Mokka.
First of all we go into wickie studio and add a project and for the target type we select object instead
of image.
Then give your project a name.
This is the same steps that we went through before except this time.
Creating a object as a target.
Once that project has been created click on it.
You then need up to 30 photographs of your object to bring into the studio or you can bring in up to
30 pictures of the object you want to move around the object and try and get a photograph of it from
all angles.
You also want it to be in an environment where you can leave out as much background detail as possible
and he can say just some of the pictures are took of this part.
As I turned it around and I made sure that there was as much sort of white space behind it to really
define where the pot was.
If he'd like to use the images that I use there attaches a resource to this lecture just drag and drop
them into the space available for the images.
Type in a w t o file name.
This will be used for the images that you'll see in unity and then you want to pick the field of view
of the camera that took the photo so he can say I'm selecting the Samsung S8 real camera but there's
a list there that you can select your own device or something that's close to your device from now it'll
go through the process of loading these images into wicked.
And it can take a little bit of time.
You don't have to do anything after these images are loaded.
It will just automatically switch over to processing.
So you'll get this cued come up for a bit and then once it starts to processing you'll get a little
progress bar that goes around.
And this can take you know up to 15 minutes before it finishes.
Let's finish you can mouse over it and click on Open in studio editor or download the WTO ofo.
Let's have a look.
This in the studio.
Editor in here.
You will get a really nice view of the point cloud data that has been created from your images and the
first time you say this is really quite impressive.
So you can actually see the 3-D feature points there in basically three a day.
And it looks great.
It's a representation of the part that I used.
Now what we want in unity is the WTO fall.
So download that and then I'll show you how it works.
Here we are backing unity.
Now this is an empty brand new 3D project and I've brought in the wiki chewed package as we always use
what I need to bring in now is the t o file and put it into my streaming assets like a chewed folder
where you put the WTC files the WTC fall for the first part that we just created is also attached as
a resource to this lecture.
Now don't worry that you don't actually have my for put to test this out on because you can test your
3D Marcuse just with printed out images of the item.
If you don't have it available otherwise do feel free to use your own object and make the W.T. OFL and
then use it as your marker.
Now I'm using something round on purpose because it will be really easy to create the occlusion for
a little bit lighter.
But don't worry if you've picked something completely different just just going through the motions
of getting this working the first time.
So he's my WJR I fall for the fruit part and I'm bringing that in here.
So you can see it shows up there.
Now we could also have a fire truck to you.
Oh father I have an example of that that you can find in their samples.
It's a three day object recognition and I also gave you a video clip actually of the 3D fire truck that
you can use the video clip of the fire truck turning around as the Mokka.
So as long as the camera can see that thing that you've made the mark of from whether it be actually
live or an image of it.
Right so we have that.
Let's go back to my assett Felda.
We're going to go to the hierarchy and into that higher I'm going to add our Wiki camera.
So let's find out we camera drag and drop that in and this time instead of an image Cheka we add an
object tracker.
So look for object and drag and drop the object tracker in.
It's going to look in the inspector very similar to the image tracker and you can probably already pick
out from this view where you have to put your WTO fall and you can say that by default it has the fire
truck one there so far just make this a bit smaller and we drop that down.
Have a look in the wicked chewed folder.
It's only giving us the WTI falls this time.
So let's click on that for it.
And add that in.
OK.
So this object tracker if you roll that out you'll see that it has a trackable item and the trackable
autumn has a drawer Roble.
Now just look at the image tracker.
You can put your pre-fab that you want to draw in the drawable area here or you can attach it as a child
to the trackable in the hierarchy because this will get turned on and off which will cause its child
to be turned on and off as well.
Currently in this version of wicked food which is we could.
I age you don't have the ability to preview the 3-D point cloud to a line where your object is going
to base.
So for that we have to use a little bit of trickery.
But what we do know is that the center of your 3-D marker is pretty much going to be 0 0 0 or so we
can put an object onto that trackable make sure that it's position is 0 0 0 and then we can start testing
it out from there and we can use the fact that you can run this in Edyta to get your object in the right
spot before you go to all the pains of having to you know build it out to a device to check where it
is a time which can become such a long process.
Right.
So enough talking.
Let's actually do this back in my assets folder so I can always find things under this trackable.
Actually I don't even need to do that dog.
We just kind of add a cube here.
I don't need to make a prefab because we're not going to instantiate it as adorable.
So it is the cube I'm creating.
Now the cube is going to be at the origin point relative to the trackable.
Everything is zeroed about it.
Now before we run this don't forget you need to get rid of that default mind camera that's still hanging
around.
And I'm also going to set my camera view to be free aspect and just make this window a bit bigger so
it can see more of it.
All right so press play and and grab your web cam and you want to try and find your object which it
has immediately.
So it's doing really well.
So my object is still sitting in the same environment that I photographed at the end hence having the
watch around it.
Now if I move around this object you can see that it's tracking it and it is putting that cube kind
of at 0 0 0 of the point cloud or or think cities because as you move around you can see how and where
it's kind of attached.
I guess it looks like it's more the front and you can tell if we come up to the top.
Like I said it is it is sitting that rather than right in the center of the Point class at the front
and center of which would have been about where my first photograph was taken from which would have
been you know probably about here.
And so it's now sitting at the front.
Now it's not absolutely perfectly accurate.
It's not as accurate as you get with the 2d markers because a lot of work and technology has gone into
those over many many years and this 3-D recognition is just quite new.
There's going to be improved features coming up in it in the next SDK and it's only going to get better
and better now depending on how well your market has been made and how unique it is from each angle
you may get a different experience each time.
So one thing about this particular spot it is a marker just got a repeating pattern and the pattern
is you know it is irregular.
But then again it's very very similar.
So it could be that you might not get the exact same position in each time or when it identifies it.
It still identifies it.
OK this is the part that has been trained but not might not quite pick up the angle that you are looking
at it from.
So if you test a few times by just getting rid of the cube and then coming back to see where it's positioned
in this case you can see from the front view of this part it's not too bad that the cube does change
position just a little bit right there.
But for the most part it comes to that position.
So let's say that this is our home position.
If you want to move that cube what I suggest in this case is that you need to do with the law of image
or at least while you're applying so could be with a still photograph or a video of this part as well.
Over in the same view is when you want to stop moving the cube around while it's still attached.
So if we want to just sort of look like it's sitting on top of that part we might do something like
that for example.
Now wall we're looking at it.
That press pause and we need to get the coordinates of where the cube is right now.
So go over into the inspector.
What I'm going to do is right up here there's a little cogwheel and you want to go down and copy component
that's going to copy the position rotation and scaling that you have done on that cue wall it has been
in play mode.
Now we're going to stop playing click on the cube and then for that transform drop down that cogwheel
and paste component values and that will put those values back in.
Now we can press play again.
So now we can test to see where the skew comes up.
OK so it's up compared to the rest of the pot which is where we had it.
It's not sitting in the center where I positioned it before.
Let's just try again.
So it's kind of up there it's not too bad but you can see what the limitations of the accuracy.
Currently with this and even this particular marker.
So you could have a very very unique marker.
You could even have something like a cube for example on each side you had a 2D images the mark of that
would be very nice and clean.
Yes.
So you're not going to get pinpoint accuracy on a 3D object like this if you just want to recognize
the object and have like some text or something come up on the screen information about that then that's
great.
That's going to work perfectly for you.
It's the positioning of things and then getting into shadowing and occluding that will cause you a few
heartaches when you start to do this.
But it's all part of the learning journey when you've got new technology like this.
And so therefore you have to think of the best experiences that you can create with the limitations
that they are and then build on them in the future.
OK so that's how to create a mock out from a 3D real world object through the use of photographs.
And now from there you can use these objects or real world objects as your Marka instead of having to
prepare images and use those.
So that allows you to put automated experiences around a 3D object and make that 3D object part of the
scenery.
So we're going to start looking at that in the next few lectures.