Now, in the previous lessons, we've incorporated our Pokémon card and asked our ARKit app to start 1
tracking it. And once it did find it, then it triggers this method and it creates a new plane 2
that is the same size as the playing card, and it renders this see-through white plane onto the card 3
which we're going to be using to render our 3D Pokémon. 4
Now, speaking of 3D Pokémons, we have to get hold of it. 5
So in this lesson, we're going to be downloading and converting the 3D Pokémon model into a format that 6
we can use in our app. In order to download the 3D Pokémon model, 7
I've included a link to this web page in the course resources list which is something Root of Evil Studios 8
has provided. 9
So they've got a repository of all of the basic Pokémon and that you can download it in various 3D formats. 10
So the one I'm looking for is, of course, the Eevee, which is interesting, 11
and it's one of the Top 10 all-time downloads because, I mean, let's face it, who doesn't like Eevee? 12
It's like my favorite Pokémon. 13
And here, you can preview the various types of Eevees that they've got. 14
You can see here that there's four different models that you can use. 15
One is from Pokémon XY. 16
One is just Eevee.obj. 17
One is called BR_Eevee-shiny, and another one is BR_Eevee. 18
So out of all of these four, I reckon this one looks the nicest, and that's the one that I want to use 19
in our project. 20
So you can see that they've got a status for these different models, and the two that are working quite 21
well are the XY_Eevee and the Eevee. 22
So when you're looking at this webpage, it's good to check out which ones should be usable and to pick 23
and select, so that you minimize your level of frustration by working with a model that has missing parts. 24
Let's go ahead and click download to grab hold of this Eevee model. And you should read through the Terms 25
and Conditions of how you can use these models, and then agree to that notice. 26
Now, once you've got that downloaded, go ahead and unzip the file, and you can see that there are a whole 27
bunch of different formats for the Eevees that we've downloaded. Now, unfortunately, none of these have 28
the format of DAE or the Collada format, which we spoke about previously ,that allows us to simply drag 29
and drop into Xcode and start using it. 30
But that's nothing to worry about. 31
One of the exciting things that Apple announced as a part of ARKit 2 is their new file format for 32
3D objects, and this is something that they're calling usdz files. 33
And this is meant to be the new format for displaying and sharing 3D content in iOS. 34
So that means I could create a 3D object in usdz and I can send that to you, and you should be able 35
to view it straight away on your iPhone or your iPad without needing any other software. 36
And one of the cool things is that if you have a device that is able to render in augmented reality, 37
so iPhone 6 Plus and above, and you've got iOS 12 installed, if you head over to the ARKit website on 38
developer.apple.com, you can actually go into the Quick Look Gallery that they provided, and you 39
can simply tap on any of these objects that have the ARKit symbol next to it. 40
So, for example, if we tap on this TV and we select the bar tab, then you can see that it'll render it 41
into my room. 42
And if you pinch, you can zoom it down to make it a little bit smaller, and you can move it around on 43
the plane than it has detected, and you can rotate it or play around with it, and view these objects direct 44
in your iPhone without needing any extra software or any apps to do this. 45
So in this lesson, I want to show you how we can take these Pokémon models in various formats, for example, 46
a very common one is .obj, 47
and convert it into usdz. In order to do the conversion, 48
we need to use the Xcode command line tools. If you head over to Xcode and preferences, and then you're 49
going to head over to Locations. 50
Now, here you have something called Command Line Tools. 51
And by default, it will be set to Xcode 9.4.1 or whatever stable version Xcode 52
you have installed. 53
Now, if you're using a beta version of Xcode 10, you will have to go and select Xcode 10 for use in 54
the Command Line Tools manually. 55
Now, if you're doing this course in October 2018 or later, then you don't have to worry about this step. 56
It should be selected Xcode 10 by default. 57
Once you've done that, the next step is to open up Terminal. And we're going to be using Terminal to convert 58
our images. 59
Now, in order to use the Xcode Command Line Tools, we're going to say Xcode command-line run, 60
so xcrun. 61
And then, the tool that we need to use is usdz_converter, and make sure that you've not 62
got any typos in here. 63
And then, the next thing we do after a space is we drag in the file that we want to convert. 64
So in our case, it's going to be in that folder that we downloaded and it's gonna be the one called 65
Eevee.obj. 66
And it should be about 143 kilobytes. 67
So let's click and drag that into our Terminal to tell it 68
what is the file that it should convert. 69
And then, after a space, we're going to tell it where it should convert it to and how to name the converted 70
file. 71
So in our case, we're going to say in the root, go to users, and then go to your username, whatever it 72
may be. 73
Now, you can see that I'm just copying this part over here. And then, I'm gonna head over to downloads 74
as well. 75
Now, inside the downloads folder is where I want to save this converted file, and I'm going to simply 76
call it 77
eevee.usdz. 78
And now, if I hit enter, it'll go through the converting process, and there is my brand-new 79
eevee.usdz file. 80
So, now if I double click on it, then you can see that it opens it up in Xcode 10, and it shows me this 81
3D model of Eevee which I can drag around and look at and move or change. 82
And there you have it. 83
You've created a USDZ model using the Xcode Command Line Tools and convert it a model from a completely 84
different format to one that we can now use inside, say, your website or insight. 85
In our case, ARKitt app. So have a play around with your Eevee and make sure that you keep a hold of 86
this file and place it somewhere easy to access, 87
for example, your desktop or your development folder. In the next lesson, we're going to be moving this 88
model into our Xcode project and we're going to be rendering it in our ARSession. 89
So for all of that and more, 90
see you on the next lesson.