1
00:00:05,780 --> 00:00:10,880
A what's up everyone Mark Price your depth slopes Stockholm and we're making great progress with our

2
00:00:11,320 --> 00:00:21,640
app and what we've done so far as we've made it so you can see three objects three 3-D objects in a

3
00:00:21,950 --> 00:00:24,610
View Controller in a scene view they're rotating.

4
00:00:24,640 --> 00:00:28,960
And when you tap it it prints the name so we know which one is being tapped and we're actually passing

5
00:00:28,960 --> 00:00:31,800
that name back to a ramp place or visi.

6
00:00:32,050 --> 00:00:39,070
And what we want to do here in the on ramp selected OK is what we want to do is we want to make it so

7
00:00:43,570 --> 00:00:47,270
it stores the name of the object that we're going to be placing.

8
00:00:47,500 --> 00:00:48,030
OK.

9
00:00:48,190 --> 00:00:53,110
And then when we need to detect when the screen is tapped again so we can actually place it in the appropriate

10
00:00:53,110 --> 00:00:53,500
spot.

11
00:00:53,510 --> 00:00:55,000
But on this screen this time.

12
00:00:55,060 --> 00:01:02,200
So we're going to need a variable to store the name of the ramps so let's go up to the top here and

13
00:01:02,200 --> 00:01:09,370
create a new variable here var and we're going to say selected ramp is going to be of type string and

14
00:01:09,370 --> 00:01:14,560
it isn't optional because it may at first there's nothing there.

15
00:01:14,740 --> 00:01:16,280
So var selected ramp.

16
00:01:16,960 --> 00:01:23,050
And what we're going to do is say selected ramp ramp name.

17
00:01:24,020 --> 00:01:25,160
That looks good to me.

18
00:01:25,450 --> 00:01:32,350
And then we just probably need to implement the touches begin to override function here.

19
00:01:32,350 --> 00:01:39,580
So let's put that let's put it here just for fun or to say touches began.

20
00:01:40,000 --> 00:01:44,950
And anytime a touch starts it'll call this code here which is what we want and then let's just write

21
00:01:44,950 --> 00:01:51,310
some code to detect the touch get it's the position of the touch and then we need to place a 3D object

22
00:01:51,400 --> 00:01:52,990
at the point that's being touched.

23
00:01:52,990 --> 00:01:56,760
OK so it detects a touch figures out where on the screen it's happening.

24
00:01:57,010 --> 00:02:06,260
And then we can place an object there and when detecting a touch on the on the view here this scene

25
00:02:06,460 --> 00:02:11,140
view you do do it a little bit differently than we just did it in the regular scene kit view.

26
00:02:11,140 --> 00:02:14,070
So let's go ahead and get started here.

27
00:02:14,140 --> 00:02:18,500
So guard let touch equals touch up first.

28
00:02:18,730 --> 00:02:25,650
So we're guarding against there not being a touch or.

29
00:02:26,350 --> 00:02:26,610
Yeah.

30
00:02:26,620 --> 00:02:30,510
We're guarding against they're not being attacked so we're grabbing touches done first.

31
00:02:30,660 --> 00:02:31,200
OK.

32
00:02:32,920 --> 00:02:37,820
And then next thing is let results equals scene view.

33
00:02:37,900 --> 00:02:44,020
Hit test we are using the similar hit test because it is using the same functionality under the hood

34
00:02:44,020 --> 00:02:44,940
that we just did.

35
00:02:44,980 --> 00:02:46,080
So hit test.

36
00:02:46,450 --> 00:02:50,990
And in this case we're going to type touch dot location for the point.

37
00:02:51,660 --> 00:02:52,200
OK.

38
00:02:52,520 --> 00:02:57,380
You didn't touch that location.

39
00:02:57,680 --> 00:02:58,410
OK.

40
00:02:59,080 --> 00:03:01,570
Seen you.

41
00:03:01,750 --> 00:03:02,250
There you go.

42
00:03:02,270 --> 00:03:06,820
OK we're calling the touch stultification function in Seamew I got confused by the syntax here.

43
00:03:06,850 --> 00:03:13,650
And then lastly we have the options and what we want in this case is a feature point.

44
00:03:14,400 --> 00:03:15,730
OK.

45
00:03:17,200 --> 00:03:19,760
We'll let this stop airing out us.

46
00:03:19,780 --> 00:03:22,480
Come on now.

47
00:03:22,540 --> 00:03:23,940
What did I spell wrong.

48
00:03:25,250 --> 00:03:26,060
Feature point.

49
00:03:26,060 --> 00:03:27,370
This looks good to me.

50
00:03:30,180 --> 00:03:32,980
Now closing closing not.

51
00:03:32,980 --> 00:03:33,580
Correct.

52
00:03:33,580 --> 00:03:34,660
What does it yelling at me for

53
00:03:37,840 --> 00:03:41,200
does not like it at all what is going on.

54
00:03:41,200 --> 00:03:47,050
Feature point feature point types Oh I called the wrong I called the wrong

55
00:03:51,130 --> 00:03:54,570
the wrong thing it's types.

56
00:03:54,570 --> 00:03:55,040
OK.

57
00:03:55,260 --> 00:04:00,350
And what I wanted to do was show you the feature point here.

58
00:04:00,600 --> 00:04:05,070
So result type result type from intersecting the nearest future point.

59
00:04:05,070 --> 00:04:06,540
This is in a market.

60
00:04:06,540 --> 00:04:10,800
And so basically remember it detects the floors in the walls and everything.

61
00:04:10,800 --> 00:04:16,500
And so when you tap it's using it's very complex under the hood math to figure out where on the wall

62
00:04:16,500 --> 00:04:18,780
or the floor that you tap and get the actual distance to stuff.

63
00:04:18,780 --> 00:04:20,250
Very cool stuff.

64
00:04:20,370 --> 00:04:23,700
Very complex stuff in there doing that for us and so that's what future point does.

65
00:04:23,700 --> 00:04:27,740
You can also look at some of the other things that they have here as well to see what they do.

66
00:04:27,780 --> 00:04:31,640
I will not be explaining them because we are using the feature point.

67
00:04:31,910 --> 00:04:36,330
It's just going to get the nearest intersection in years in your room or you're outside or wherever

68
00:04:36,450 --> 00:04:37,230
it's detecting.

69
00:04:37,230 --> 00:04:38,010
OK.

70
00:04:38,550 --> 00:04:40,060
Guard let hit.

71
00:04:40,070 --> 00:04:44,900
Feature equals results that last else return.

72
00:04:45,150 --> 00:04:47,730
So now we're getting the results of a tap.

73
00:04:47,730 --> 00:04:50,040
So here's something really important.

74
00:04:50,040 --> 00:04:56,700
Understand sometimes a market can't find angles if your room is too dark it can't find an angle if it's

75
00:04:56,700 --> 00:04:58,200
too dark anywhere or too fuzzy.

76
00:04:58,200 --> 00:05:02,700
Or let's say you're just looking at the ground but it can't see walls or can't see a car in the distance

77
00:05:02,700 --> 00:05:05,270
or something that can give it some context.

78
00:05:05,490 --> 00:05:07,590
You may get nothing here and it will return.

79
00:05:07,590 --> 00:05:13,280
So if you're in our app and other apps let's say especially in our app if you're tapping and like nothing's

80
00:05:13,290 --> 00:05:15,490
happening it's because we're hitting this returns same.

81
00:05:15,510 --> 00:05:19,240
And the reason why is because it's not finding the feature on the ground.

82
00:05:19,350 --> 00:05:24,240
But you'll notice when you move closer to something where there's two objects it works.

83
00:05:24,240 --> 00:05:30,000
And so it needs it needs context in order to be able to place the object.

84
00:05:30,030 --> 00:05:30,750
OK.

85
00:05:31,500 --> 00:05:33,780
Hit feature results that last else return.

86
00:05:33,780 --> 00:05:39,690
So to make sure that we actually find an object when when it's being tapped it finds that reference

87
00:05:39,690 --> 00:05:39,980
point.

88
00:05:39,990 --> 00:05:48,210
OK let it transform equals as seen matrix for came.

89
00:05:48,430 --> 00:05:55,510
And what we're going to do is we're just going to pass in the the world transform the hit feature so

90
00:05:55,510 --> 00:05:58,900
hit feature world transform.

91
00:05:59,360 --> 00:06:00,020
OK.

92
00:06:00,250 --> 00:06:02,950
So we're grabbing the transform from the from the tap.

93
00:06:02,950 --> 00:06:03,370
OK.

94
00:06:03,370 --> 00:06:07,810
Meaning remember if there was nothing we're returning we're not even getting here otherwise there was

95
00:06:07,810 --> 00:06:14,380
something and we are going to take it and get the transform for it so we can actually use it and place

96
00:06:14,380 --> 00:06:15,190
a 3-D object.

97
00:06:15,190 --> 00:06:15,890
OK.

98
00:06:16,360 --> 00:06:22,360
Let me get position equals s.c and vector 3 make.

99
00:06:22,430 --> 00:06:24,040
We're going to say hit transform

100
00:06:26,650 --> 00:06:28,830
em for one hit.

101
00:06:28,830 --> 00:06:41,630
Transform em for two and get transformed for three and a.

102
00:06:41,650 --> 00:06:42,330
Thank you.

103
00:06:43,870 --> 00:06:45,240
Make sure there's no errors here.

104
00:06:47,960 --> 00:06:48,430
OK.

105
00:06:48,600 --> 00:06:49,640
And you're probably wondering.

106
00:06:49,640 --> 00:06:53,760
Hey Mark how do you know what for one and for two and three is.

107
00:06:53,760 --> 00:07:00,330
Well if we can click this here OK we're going to be sadly disappointed because there's not a whole lot

108
00:07:00,330 --> 00:07:06,060
of information on what these are but what's happening is this SDN matrix for storing data in regards

109
00:07:06,060 --> 00:07:10,370
to the transform from this from this hit test here.

110
00:07:10,470 --> 00:07:14,030
And because Apple documentation and apple example say so.

111
00:07:14,070 --> 00:07:20,700
I know that for one and for two and for three are the translation or the positioning and floats that

112
00:07:20,700 --> 00:07:21,980
you need to access.

113
00:07:22,080 --> 00:07:25,280
Outside of that I honestly I'm not sure how you would figure it out.

114
00:07:25,280 --> 00:07:30,330
There's no documentation on there but in the Apple documentation they do reference these three points

115
00:07:30,390 --> 00:07:33,000
as translation or position.

116
00:07:33,000 --> 00:07:37,590
And so that's what we're grabbing here of the hit position which is why you got to read Apple documentation

117
00:07:38,610 --> 00:07:43,500
usually it's very safe to do things the way that they do it and their example projects.

118
00:07:43,500 --> 00:07:50,900
So what we've done here is we have we've looked at we've done a hit test so we grabbed the touch.

119
00:07:50,900 --> 00:07:53,980
We've done a hit test on that touch on to get the results.

120
00:07:53,990 --> 00:07:55,110
Now if there was a tap.

121
00:07:55,220 --> 00:07:55,730
OK.

122
00:07:55,880 --> 00:07:59,870
What we're doing is we're grabbing the world transform of that touch.

123
00:07:59,990 --> 00:08:01,310
OK.

124
00:08:01,310 --> 00:08:08,900
So the hit feature is going to it's going to find the horizontal and vertical position of where you

125
00:08:08,900 --> 00:08:09,430
tapped.

126
00:08:09,440 --> 00:08:13,050
And again you know make sure you tap on something that has context.

127
00:08:13,100 --> 00:08:14,990
We're grabbing the world transform for that.

128
00:08:15,050 --> 00:08:19,900
And then we're creating a positioning vector 3 here of the actual position in 3D accordant space so

129
00:08:19,900 --> 00:08:21,220
we can place an object.

130
00:08:21,430 --> 00:08:23,830
And you don't have to understand this completely in order to use it.

131
00:08:23,990 --> 00:08:30,080
But this is typically the process you'll follow when placing objects in a market in a 3D space very

132
00:08:30,080 --> 00:08:31,400
similar to this here.

133
00:08:31,720 --> 00:08:35,790
OK the next step is to actually place an object on the screen.

134
00:08:36,110 --> 00:08:37,090
So how do we do that.

135
00:08:37,090 --> 00:08:41,240
Well we're going to have to create the node like we did in the in the picker with just three objects

136
00:08:41,270 --> 00:08:43,580
and then place it at the position.

137
00:08:43,610 --> 00:08:48,510
So down here we can create a function called Place ramp.

138
00:08:48,730 --> 00:08:53,850
We're going to pass in the position of S in vector 3 like so.

139
00:08:54,440 --> 00:08:56,200
And then let's call this function up here.

140
00:08:56,330 --> 00:08:58,720
So we're going to say placed ramp.

141
00:08:58,730 --> 00:09:06,570
And let's just pass in the hit position like so and then what do we need to do here we need to actually

142
00:09:06,570 --> 00:09:08,230
get those ramps again.

143
00:09:08,380 --> 00:09:14,690
So see here yeah we've got time let's do it so over here and our rent picker.

144
00:09:15,000 --> 00:09:20,670
OK we've got these We've got these three objects here as you can see these three 3-D objects and we

145
00:09:20,670 --> 00:09:27,090
need to be able to have similar code so what I want to do is I want to refactor to make this more more

146
00:09:27,090 --> 00:09:27,900
reusable.

147
00:09:28,000 --> 00:09:34,640
OK so we're going to go to our project here and new group and we're going to call this model.

148
00:09:35,520 --> 00:09:39,200
And inside the model folder we're going to add a new file.

149
00:09:39,600 --> 00:09:40,300
OK.

150
00:09:40,620 --> 00:09:44,580
And what we want to do is just make this a swift file and make empty right now.

151
00:09:44,910 --> 00:09:52,040
And let's call this ramp and we're going to import scene kit like so.

152
00:09:52,050 --> 00:09:58,500
Class is going to be ramp and then what we're going to do is create a series of functions static functions

153
00:09:58,530 --> 00:10:01,670
that we can just call to get the things that we want to get.

154
00:10:01,720 --> 00:10:11,140
So what we can do is we can say a class phunk get pipe for getting the half pipe and it's going to return

155
00:10:11,550 --> 00:10:14,390
an SDN node like so.

156
00:10:14,470 --> 00:10:20,350
And then what we can do is we can go to a ramp picker code and we can copy some of the stuff here.

157
00:10:20,350 --> 00:10:28,330
So just take this copy the pipe go back to our ramp paste it here will change it to let's this time

158
00:10:29,500 --> 00:10:40,660
and let But instead of adding to the root note we'll just return the note itself like so very good.

159
00:10:40,850 --> 00:10:50,900
And then we'll create one for will create two others for class phunk get pyramid CNO and then world

160
00:10:51,230 --> 00:10:58,200
class phunk get quarter for the quarter pipe as seen.

161
00:10:59,170 --> 00:11:00,160
Like so.

162
00:11:00,410 --> 00:11:05,450
And let me point out here where we're specifically grabbing objects.

163
00:11:05,480 --> 00:11:06,090
OK.

164
00:11:06,130 --> 00:11:09,660
And placing them with a certain scale and things because we want them to look a certain way.

165
00:11:09,860 --> 00:11:14,900
If you're actually building a game or there's lots of things going on objects being instantiated coming

166
00:11:14,900 --> 00:11:20,390
from different places of course you wouldn't manually like place individual objects here because you

167
00:11:20,390 --> 00:11:24,030
would build a manage it all by say scene kids.

168
00:11:24,110 --> 00:11:26,630
I think it's pretty rough to work with I would not make a game and sink it.

169
00:11:26,660 --> 00:11:29,540
If you want to make full scale game do it in unity 3D.

170
00:11:29,720 --> 00:11:31,320
Absolutely for sure.

171
00:11:31,550 --> 00:11:35,480
And we do have courses on that an amazing course actually.

172
00:11:35,480 --> 00:11:36,800
And it's so easy to use.

173
00:11:36,800 --> 00:11:40,550
And so if you really are serious about working with a market and making something immersive where you

174
00:11:40,550 --> 00:11:45,070
don't need the standard controls from Iowa has worked with unity.

175
00:11:45,080 --> 00:11:46,640
It's absolutely fantastic.

176
00:11:46,640 --> 00:11:47,210
OK.

177
00:11:47,480 --> 00:11:52,700
And so Node 1 action rotate we're going to take this out because we don't want the we don't want to

178
00:11:52,700 --> 00:11:58,730
run the rotation on the on the objects that are in the in the market.

179
00:11:58,880 --> 00:12:00,430
So I want to take that out there.

180
00:12:00,560 --> 00:12:09,670
And so there's our get pipe Let's go back to our picker and let's go ahead and copy this one so ramp

181
00:12:10,760 --> 00:12:11,550
ramp.

182
00:12:11,570 --> 00:12:12,910
So this is the pyramid right.

183
00:12:13,000 --> 00:12:13,350
Yep.

184
00:12:13,610 --> 00:12:15,130
This is great.

185
00:12:15,480 --> 00:12:19,630
Let here and here we're just we're ready factory making a little more better.

186
00:12:19,640 --> 00:12:24,270
It's not a huge improvement but it's it's a little improvement and that's good enough for me.

187
00:12:24,350 --> 00:12:29,400
Return node like so.

188
00:12:29,630 --> 00:12:39,890
And let's go over here again to our quarter pipe and do the same thing.

189
00:12:39,990 --> 00:12:49,290
Good quarter and we're going to say let and let us get rid of the action and let's get rid of the root

190
00:12:49,290 --> 00:12:57,990
node thingy and let's return the node like so and then what we can do is go back to our ramp picker

191
00:12:58,230 --> 00:13:03,720
and we can refactor this here which is nice and you know what let's actually let's put this in a function

192
00:13:03,720 --> 00:13:06,890
as well to rotate action.

193
00:13:07,020 --> 00:13:10,070
Let's put it in there so let's go back to a ramp actually.

194
00:13:10,160 --> 00:13:10,550
That's great.

195
00:13:10,540 --> 00:13:22,610
Another class function class phunk start to make this bigger for you here we go start rotation pass

196
00:13:22,630 --> 00:13:25,950
in a node and we're just going to rotate it as C.A..

197
00:13:26,640 --> 00:13:35,460
All we have to do is take those lines of code from the ramp picker namely the rotation like so place

198
00:13:35,460 --> 00:13:44,420
it here and then let's grab the run action like so and place it in the ramp as well.

199
00:13:45,080 --> 00:13:54,340
So I just do something silly and this is my go here it goes in the ramp.

200
00:13:54,340 --> 00:13:55,350
There we go.

201
00:13:55,840 --> 00:13:58,840
And then back to the ramp put the ramp picker.

202
00:13:58,840 --> 00:14:04,790
We will do the no run action command see it over here in our ramp.

203
00:14:04,990 --> 00:14:10,400
OK so we're just taking this note that was passed in and we're just running an action on it.

204
00:14:10,600 --> 00:14:18,670
So now what we can do now that this is all cleaned up we can make our code it's a cleanup I'll be here

205
00:14:18,670 --> 00:14:21,000
and now we can make our code more cleanup and the rent picker.

206
00:14:21,120 --> 00:14:26,010
So what I want to do is I want to just delete all this stuff here.

207
00:14:28,050 --> 00:14:28,820
OK.

208
00:14:29,060 --> 00:14:30,580
And this too.

209
00:14:31,180 --> 00:14:38,150
And it should be pretty easy to say let pipe equals frap that get pipe and then we're going to say ramp

210
00:14:38,170 --> 00:14:43,750
does start rotation and will pass in the pipe to start rotating it and then we'll say seen that root

211
00:14:43,750 --> 00:14:47,900
node add child and we're just going to say pipe.

212
00:14:48,220 --> 00:14:58,300
No big deal like so we'll do the same thing for the other one so let here mid equals ramp get pyramid

213
00:14:59,620 --> 00:15:08,770
ramp start rotation and we were going to say pyramid and then seen that root node add child node and

214
00:15:08,770 --> 00:15:16,900
we're going to say pyramid pyramid and one more let quarter pipe or quarter equals ramp get quarter

215
00:15:19,170 --> 00:15:27,660
and we're to say ramp dot start rotation quarter and then we're going to say seen out root node add

216
00:15:27,660 --> 00:15:34,530
child node and we're going to say quarter.

217
00:15:35,100 --> 00:15:40,080
So let's make sure that our code is still working meaning the ramps are still there same positions and

218
00:15:40,080 --> 00:15:41,740
that they are rotating.

219
00:15:41,760 --> 00:15:50,160
So it's run the app and see secret button and they are rotating sure enough they're rotating and this

220
00:15:50,160 --> 00:15:53,640
looks really really good.

221
00:15:53,640 --> 00:15:53,910
Cool.

222
00:15:53,910 --> 00:15:55,800
So what we've done is we've just refactored our code.

223
00:15:55,800 --> 00:15:56,720
We've cleaned it up.

224
00:15:56,760 --> 00:15:58,170
We've made it more reusable.

225
00:15:58,210 --> 00:16:04,860
Now what we can do to stop this is we can go into our ramp placer which I'm already here and now we

226
00:16:04,860 --> 00:16:06,800
can actually place the ramp.

227
00:16:06,810 --> 00:16:14,030
We can we can use that those same functions that we just used and place the ramp somewhere on the screen.

228
00:16:14,140 --> 00:16:14,820
OK.

229
00:16:14,970 --> 00:16:17,420
So it should be as simple as LET.

230
00:16:17,460 --> 00:16:21,030
Ramp equals Well shoot.

231
00:16:21,030 --> 00:16:22,430
We don't know it.

232
00:16:22,770 --> 00:16:25,740
We don't know which ramp to ramp to use.

233
00:16:25,740 --> 00:16:30,150
We know the selected name of a ramp but we don't know which one to use.

234
00:16:30,150 --> 00:16:37,220
So we probably need one more function in our ramp here so we can actually just determine which ramp

235
00:16:37,220 --> 00:16:37,850
to get.

236
00:16:37,850 --> 00:16:39,290
So I'll put up here at the top.

237
00:16:39,290 --> 00:16:46,680
A new function and we're going to say class phunk get ramp for name.

238
00:16:46,730 --> 00:16:47,410
All right.

239
00:16:47,450 --> 00:16:52,420
Or to say ramp name of type string.

240
00:16:52,670 --> 00:16:53,130
Perfect.

241
00:16:53,150 --> 00:16:56,050
And we're going to return an LCN node.

242
00:16:56,540 --> 00:16:58,540
We're simply going to switch the ramp name.

243
00:16:58,620 --> 00:16:59,330
That's all.

244
00:16:59,330 --> 00:16:59,950
All right.

245
00:17:00,110 --> 00:17:02,060
No big deal.

246
00:17:02,150 --> 00:17:10,040
So if the case is pipe Let's go ahead and just return the ramp that get pipe.

247
00:17:10,040 --> 00:17:10,970
All right.

248
00:17:10,970 --> 00:17:18,950
And then if the case is quarter well its return ramp get quarter.

249
00:17:19,370 --> 00:17:30,170
And if the case is pyramid let's just return the ramp get pyramid like so and the default we will return

250
00:17:30,980 --> 00:17:35,030
ramp get pipe like so

251
00:17:38,450 --> 00:17:40,580
that should work.

252
00:17:40,700 --> 00:17:41,590
It's giving us an Erich's.

253
00:17:41,590 --> 00:17:47,390
It did not return this wonderful wonderful go away read.

254
00:17:47,390 --> 00:17:47,980
There we go.

255
00:17:48,110 --> 00:17:48,430
OK.

256
00:17:48,440 --> 00:17:49,080
Cool.

257
00:17:49,370 --> 00:17:58,460
So back around placer now we can actually get our ramp just by passing in the name of the ramp so let's

258
00:17:58,460 --> 00:18:07,230
ramp equals ramp get ramp for name and we're going to passing the selected ramp OK.

259
00:18:08,170 --> 00:18:15,370
And what we actually need to do here is if the left ramp name equals select the ramp because it's an

260
00:18:15,370 --> 00:18:19,860
optional and it may or may not have a value in it and we don't want to crash.

261
00:18:19,870 --> 00:18:26,110
So this is a time when a user could actually have not done something correctly and it could be nil.

262
00:18:26,140 --> 00:18:29,210
And so we want to make sure we account for it here with the optional.

263
00:18:29,680 --> 00:18:32,390
And in this case we will not say ramp name.

264
00:18:33,130 --> 00:18:39,130
OK so there's our ramp and then let's go ahead and give it a position.

265
00:18:39,130 --> 00:18:43,380
So my tab.

266
00:18:44,050 --> 00:18:44,520
OK.

267
00:18:44,710 --> 00:18:50,130
So the ramp up position is going to be equal to the position where the the finger tap.

268
00:18:50,160 --> 00:18:51,210
OK.

269
00:18:51,360 --> 00:18:52,240
Like so.

270
00:18:52,540 --> 00:18:58,280
And then for the scale we want to set the schedule back to normal size remember on the on the list with

271
00:18:58,300 --> 00:19:00,160
three items made it really small.

272
00:19:00,160 --> 00:19:07,420
We want to do the default size so ramped up scale is going to be equal to SDN vector 3 make and we're

273
00:19:07,420 --> 00:19:16,550
going to say point zero 0.01 0.01 and 0.01 So we're just getting it back to its default size so it's

274
00:19:16,550 --> 00:19:28,890
nice and large and they're going to say seen view that seen that root node not add child node and we're

275
00:19:28,900 --> 00:19:35,700
going to pass in the ramp that we just get from our ramp class.

276
00:19:35,890 --> 00:19:36,920
Cool.

277
00:19:36,970 --> 00:19:38,680
This is really cool.

278
00:19:38,680 --> 00:19:41,070
I'm really curious to see if it works.

279
00:19:41,440 --> 00:19:45,130
So in order to test this we're going to actually have to use it on a device.

280
00:19:45,130 --> 00:19:47,300
So let's do that now.

281
00:19:48,220 --> 00:19:52,780
So I've got my actual phone attached here and I am using the cable you can use the Wi-Fi building but

282
00:19:52,780 --> 00:19:57,940
it's a lot slower that I found so the cable is much faster and I'm going to run it and make sure we

283
00:19:57,940 --> 00:20:00,460
don't have any crashes make sure everything works.

284
00:20:00,670 --> 00:20:05,110
And it may not work perfectly because my office right here is really dark and it needs light in order

285
00:20:05,110 --> 00:20:06,200
to process this.

286
00:20:06,310 --> 00:20:10,280
But I at least want to see if something gets on the screen.

287
00:20:10,280 --> 00:20:11,650
So I'm running the app here.

288
00:20:11,950 --> 00:20:17,170
And of course we see the big half pipe from before because it loads by default we need to get rid of

289
00:20:17,170 --> 00:20:17,700
that.

290
00:20:17,710 --> 00:20:22,400
I think we need to delete the one that's coming up by default so I'm going to stop this real quick not

291
00:20:22,450 --> 00:20:24,320
my recording on my phone.

292
00:20:24,580 --> 00:20:27,200
I was loving and the screen recording pretty nifty.

293
00:20:27,550 --> 00:20:30,540
And let's make sure we get rid of any default have pipes on here yeah.

294
00:20:30,700 --> 00:20:32,090
This pipe that.

295
00:20:32,120 --> 00:20:32,910
Da.

296
00:20:33,130 --> 00:20:41,390
Well we actually want to do is create an empty scene here let's just create a new scene file new file.

297
00:20:41,590 --> 00:20:49,550
We want to do resources and a scene kit scene file and I'm just going to call this main main scene here

298
00:20:50,050 --> 00:20:55,210
save it and I'm just going to put this over here in the our assets folder.

299
00:20:55,390 --> 00:20:59,200
And what I want to do is we go to empty scene which is fine.

300
00:20:59,200 --> 00:21:00,940
So this is good.

301
00:21:01,000 --> 00:21:10,990
What I want to do here is go to our ramp placer and I want to just load this new scene instead this

302
00:21:10,990 --> 00:21:19,460
main scene here OK so we're going to do is change this from pipe that DADT to main dot s c and.

303
00:21:19,610 --> 00:21:20,270
OK.

304
00:21:20,610 --> 00:21:30,030
And what I also want to do here on the scene where we're at is type in scene view auto enable default

305
00:21:30,030 --> 00:21:32,670
lighting to true to set default lighting here.

306
00:21:33,120 --> 00:21:33,660
OK.

307
00:21:34,140 --> 00:21:37,200
So let's go ahead and run this again.

308
00:21:37,330 --> 00:21:49,060
I mean we record it on my phone run it OK it's running in the big huge half pipe is gone.

309
00:21:49,150 --> 00:21:53,130
I'm trying to tap but nothing is happening.

310
00:21:56,170 --> 00:21:59,140
Oh and I know why it's not because we haven't selected one yet.

311
00:21:59,140 --> 00:21:59,930
That's why.

312
00:22:00,340 --> 00:22:05,540
Let's select an object analyst at the pyramid.

313
00:22:05,750 --> 00:22:10,870
We also forgot to dismiss the view controller tap off though and it dismisses fine.

314
00:22:10,930 --> 00:22:13,800
Let's tap somewhere and there it is.

315
00:22:13,810 --> 00:22:14,830
It's definitely working.

316
00:22:14,980 --> 00:22:18,200
As you can see but it's it's found a bad surface here.

317
00:22:18,220 --> 00:22:19,360
Again it's really dark.

318
00:22:19,360 --> 00:22:20,490
You see him moving around here.

319
00:22:20,500 --> 00:22:21,890
You have to do a lot of this.

320
00:22:22,090 --> 00:22:26,330
It's really dark here and it's just not placing it in the right spot.

321
00:22:26,380 --> 00:22:31,030
And so of course we're going to build tools to fix this but also the room is not a great test for this

322
00:22:31,030 --> 00:22:33,910
because it's very dark and it can't detect the walls and the surface very well.

323
00:22:33,910 --> 00:22:38,740
But it did place it there and it's the right size in my opinion so very cool.

324
00:22:38,740 --> 00:22:40,350
So it's definitely working.

325
00:22:40,840 --> 00:22:44,940
We just need to make it a little more accurate so.

326
00:22:45,160 --> 00:22:46,000
So it's working.

327
00:22:46,000 --> 00:22:46,740
We did it.

328
00:22:46,810 --> 00:22:50,770
And if you're going to find yourself when working with Erica you're going be running outside of the

329
00:22:50,770 --> 00:22:52,180
house a lot and moving around.

330
00:22:52,180 --> 00:22:57,490
At least I did when I had to build this made many many trips because the rooms just not a good example

331
00:22:57,500 --> 00:23:01,030
especially since we're doing ramps like high fives they need to be really big and it's not going to

332
00:23:01,030 --> 00:23:02,400
fit in my house.

333
00:23:02,530 --> 00:23:07,060
So we're going to call this video done what we've done is we've actually we refactored some code so

334
00:23:07,400 --> 00:23:13,290
our our assets are usable are seen files are usable and then what happens is we tap on the screen some

335
00:23:13,290 --> 00:23:18,670
where it does detection and then we get the point we grab the ramp and we place it there and it's actually

336
00:23:18,670 --> 00:23:19,820
we've got our air working.

337
00:23:19,840 --> 00:23:24,310
We've accomplished what we need to do but we need to do more cleanup now we need to implement controls

338
00:23:24,310 --> 00:23:28,840
removing things and just create a better solution here altogether so that's it for now.

339
00:23:28,870 --> 00:23:30,420
Let's finish this up.

340
00:23:30,430 --> 00:23:32,800
Mark Price of slopes dot com see assume.

