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