1
00:00:06,210 --> 00:00:08,480
Hello everyone and welcome back to class.

2
00:00:08,490 --> 00:00:11,060
Mark Price here at Dove slopes dot com.

3
00:00:11,070 --> 00:00:16,500
And what we've done so far is we have got our pop overview controller with the scene view in it and

4
00:00:16,500 --> 00:00:20,780
we are loading the half pipe into it and we placed it and scaled it cetera.

5
00:00:21,000 --> 00:00:24,080
And what we want to do in this video is get the other ones in there.

6
00:00:24,120 --> 00:00:27,090
So let's go ahead and do that now we know we've got a half pipe.

7
00:00:27,120 --> 00:00:27,850
We have a pyramid.

8
00:00:27,870 --> 00:00:29,710
And we have the quarter pipe.

9
00:00:29,840 --> 00:00:30,120
OK.

10
00:00:30,130 --> 00:00:31,800
So let's do the pyramid.

11
00:00:31,800 --> 00:00:36,440
Next we're going to say let.

12
00:00:36,990 --> 00:00:42,940
Well what we just kind of use the ready we should actually change the name around a little bit.

13
00:00:43,050 --> 00:00:47,770
Let's call this pipe and call this pipe.

14
00:00:47,810 --> 00:00:48,770
Here we go.

15
00:00:49,080 --> 00:01:01,450
And then we're going to say let pyramid equals the unseen named Art see an asset slash pyramid pyramid.

16
00:01:01,500 --> 00:01:03,890
DA which is what we've named it.

17
00:01:04,470 --> 00:01:08,830
And then we got that note again.

18
00:01:09,690 --> 00:01:15,550
Maybe we should do is change this to VAR's and reuse them.

19
00:01:15,630 --> 00:01:17,410
That's even better.

20
00:01:17,740 --> 00:01:18,830
A little bit of refactoring.

21
00:01:18,840 --> 00:01:21,630
No big deal no big deal at all.

22
00:01:21,630 --> 00:01:24,120
And let's just back to J.

23
00:01:26,240 --> 00:01:31,260
Avoir or B.J. Inbar note and now we can do is just reuse them.

24
00:01:31,270 --> 00:01:33,450
So B.J. equals this.

25
00:01:33,720 --> 00:01:34,090
OK.

26
00:01:34,180 --> 00:01:43,750
Say a. equals OPG root node child node with name.

27
00:01:43,750 --> 00:01:46,790
We're going to say pyramid recursively true.

28
00:01:46,800 --> 00:01:53,860
Now if you're wondering hey Mark why are you overwriting your object here won't that replace it in the

29
00:01:53,860 --> 00:01:54,390
scene.

30
00:01:54,390 --> 00:01:55,340
Well no.

31
00:01:55,860 --> 00:02:00,900
And here's the reason why it's this line of code right here once you've created the node and we've grabbed

32
00:02:00,900 --> 00:02:03,620
it we added as a child node of the scene.

33
00:02:03,620 --> 00:02:06,840
So now the child node is holding reference to that.

34
00:02:06,870 --> 00:02:12,180
And so even if we delete this reference here with a new object it's not going replace the object that's

35
00:02:12,330 --> 00:02:15,330
being held by the by the scene itself.

36
00:02:15,330 --> 00:02:19,260
So by this line of code here by adding it to another object or adding a child note that now contains

37
00:02:19,260 --> 00:02:24,150
a reference to the old object which means we're safe to get rid of this object we've been using here

38
00:02:24,360 --> 00:02:25,700
and replace it with the pyramid.

39
00:02:25,890 --> 00:02:33,210
So just one of those things like a little thing that could be very confusing or cause a bug and you

40
00:02:33,210 --> 00:02:36,600
have to kind of understand code and references and how that works.

41
00:02:36,600 --> 00:02:41,630
So we got our we got our object we got our node.

42
00:02:41,880 --> 00:02:46,020
The next thing we want to do is set the scale and the position of the pyramid.

43
00:02:46,020 --> 00:02:56,550
So we're inside no doubt scale can be equal to A C and vector 3 make and zero point zero zero three

44
00:02:56,550 --> 00:03:01,770
to zero point zero zero three to zero point zero zero three cheerly.

45
00:03:01,770 --> 00:03:03,420
These are numbers that worked for me before.

46
00:03:03,420 --> 00:03:05,590
We may have to adjust which is OK.

47
00:03:05,940 --> 00:03:10,650
Node position equals C-n vector 3 make.

48
00:03:10,720 --> 00:03:19,290
And we're going to say negative zero point nine five negative zero point nine and negative 1 and we

49
00:03:19,290 --> 00:03:24,140
may have to adjust that as well too and then seen the root node.

50
00:03:24,420 --> 00:03:33,990
Add child node and we're going to say node like so cool and then move this preferred content size command

51
00:03:34,050 --> 00:03:34,690
x.

52
00:03:34,920 --> 00:03:38,230
And let's just put it right here

53
00:03:41,470 --> 00:03:42,000
OK.

54
00:03:42,290 --> 00:03:44,650
Let's see if this works let's run it on the simulator

55
00:03:48,250 --> 00:03:50,160
so that iPhone 7 you go

56
00:03:53,880 --> 00:03:54,540
in we're running.

57
00:03:54,580 --> 00:03:58,570
It's click that hit an invisible icon here and fix it eventually.

58
00:03:58,570 --> 00:03:58,860
OK.

59
00:03:58,870 --> 00:04:03,460
So we've got this ramp way up here and then we got this little guy right here it's way too small.

60
00:04:03,460 --> 00:04:08,220
We're going to fix it and we're going to want to move it up more towards the middle which is OK.

61
00:04:08,530 --> 00:04:09,450
No big deal.

62
00:04:09,460 --> 00:04:11,450
So bigger and a little higher up.

63
00:04:11,470 --> 00:04:20,910
So instead of 3:2 Let's go ahead and say I want to say 5 to 5 2 and 5 2.

64
00:04:21,120 --> 00:04:22,150
Let's do the size first.

65
00:04:22,210 --> 00:04:23,530
Run it again.

66
00:04:23,640 --> 00:04:28,490
I want to do the size first before I start messing with position so I can make sure that it's in it's

67
00:04:28,870 --> 00:04:32,150
we can adjust accordingly.

68
00:04:32,590 --> 00:04:33,600
A little bit bigger.

69
00:04:33,670 --> 00:04:38,730
I'm going to say 5 8 5 8 and 5 8

70
00:04:50,430 --> 00:04:51,790
perfect that's a good size.

71
00:04:51,960 --> 00:04:52,290
OK.

72
00:04:52,320 --> 00:04:53,450
It's not centered though.

73
00:04:53,550 --> 00:05:01,550
So we'll just say on the X let's do negative 1 and give it a shot.

74
00:05:08,750 --> 00:05:09,680
Cool.

75
00:05:09,770 --> 00:05:10,830
That looks great on the center.

76
00:05:10,850 --> 00:05:11,960
Now let's bring it up a little bit.

77
00:05:11,960 --> 00:05:12,820
It's too low.

78
00:05:12,920 --> 00:05:13,660
Just a little bit.

79
00:05:13,670 --> 00:05:16,590
So we're at negative nine.

80
00:05:16,820 --> 00:05:19,970
So let's say negative.

81
00:05:20,010 --> 00:05:23,010
That's interesting is so far down negative seven Let's try that.

82
00:05:25,840 --> 00:05:27,280
One negative 0.7

83
00:05:33,010 --> 00:05:36,430
and a little bit higher and say six 5

84
00:05:46,010 --> 00:05:49,300
wonderful I think that looks good and we can move it up later if we need to.

85
00:05:49,300 --> 00:05:50,700
So we've got the half pipe.

86
00:05:50,870 --> 00:05:54,800
We have the pyramid and now we just need to get our quarter pipe.

87
00:05:54,920 --> 00:05:56,430
No big deal.

88
00:05:56,510 --> 00:06:15,770
So B.J. equals as seen named Art and assets slash quarter DHP and Noad equals Jay Root node child node

89
00:06:16,810 --> 00:06:21,690
with name Korder recursively true.

90
00:06:22,190 --> 00:06:25,530
And then we'll set the scale and the position of the quarter pipe.

91
00:06:25,610 --> 00:06:37,850
So let's say No dot scale is equal to s c and vector make and what we have here.

92
00:06:37,890 --> 00:06:40,390
We've got four quarter Piatt.

93
00:06:40,490 --> 00:06:50,720
We're gonna say I'm going to do the same number as the twins appear 0 0 5 8 and zero point 0 0 5 8 and

94
00:06:50,800 --> 00:06:54,100
0 0 0 5 8.

95
00:06:54,150 --> 00:07:03,770
And that looks good and we're going to say no position equals CN vector 3 make and scroll is up here

96
00:07:03,770 --> 00:07:04,820
for you.

97
00:07:05,470 --> 00:07:07,340
And what we want to do for a position.

98
00:07:07,370 --> 00:07:09,900
We want to say negative 1.

99
00:07:10,310 --> 00:07:22,540
And then for this position so we know that going lower in these numbers brings it.

100
00:07:22,770 --> 00:07:24,860
What does it do it brings it downwards.

101
00:07:24,900 --> 00:07:26,020
Well actually no.

102
00:07:26,040 --> 00:07:29,520
Point seven is way up there at the top So yeah it's going to bring it down so we want to make this even

103
00:07:29,520 --> 00:07:33,590
more so in our in our positioning here.

104
00:07:33,590 --> 00:07:36,290
So let's say what.

105
00:07:36,630 --> 00:07:39,290
Zero negative zero point nine.

106
00:07:39,330 --> 00:07:46,290
Make it even lower and then we say negative 1 and then we're going to say seen the root node taught

107
00:07:46,490 --> 00:07:50,410
at child node and we're guessing note.

108
00:07:51,060 --> 00:07:56,590
So let's run it and see if we got lucky and it worked in the very first try.

109
00:07:58,010 --> 00:08:06,300
At least that it got in the right spot for us.

110
00:08:06,330 --> 00:08:06,810
All right.

111
00:08:07,050 --> 00:08:08,630
So it's not low enough for sure.

112
00:08:08,700 --> 00:08:09,980
The size is good though.

113
00:08:10,080 --> 00:08:11,820
I really like the size.

114
00:08:11,820 --> 00:08:15,040
So I just want to bring it even lower.

115
00:08:15,740 --> 00:08:18,270
It's interesting that it's putting it in the same spot.

116
00:08:19,550 --> 00:08:21,880
Point nine Why would that be in the same spot.

117
00:08:21,920 --> 00:08:22,790
X 9.

118
00:08:22,790 --> 00:08:26,730
I'm not really sure let's say negative 2.

119
00:08:27,230 --> 00:08:30,000
Just to see what happens.

120
00:08:30,100 --> 00:08:30,940
A big change

121
00:08:42,900 --> 00:08:43,900
it's a negative too.

122
00:08:43,920 --> 00:08:46,760
Got it there but not quite where we want it.

123
00:08:47,250 --> 00:09:07,670
So let's go a little bit lower and say negative 2.6 rerun it.

124
00:09:07,760 --> 00:09:10,730
It's a little too low let's say 2.5.

125
00:09:10,880 --> 00:09:15,830
And I think what we're going to need to do is bring up the pyramid a little bit more so negative six

126
00:09:15,830 --> 00:09:19,610
point three.

127
00:09:20,070 --> 00:09:20,750
Let's run it.

128
00:09:33,230 --> 00:09:36,290
A little bit better.

129
00:09:36,520 --> 00:09:45,780
And one of the pyramid up and moved the quarter pipe up pyramid is going to go to say 6 0 and quarter

130
00:09:45,780 --> 00:09:55,800
pipes going to go to two point two for a run it just testing it out trial on air.

131
00:09:55,880 --> 00:10:02,330
Maybe you're wondering hey Mark White Why didn't you just write an algorithm to make a grid and place

132
00:10:02,330 --> 00:10:03,800
the objects in the grid.

133
00:10:03,830 --> 00:10:10,640
And like I said I could have done that but the math is quite extensive in order to detect how big the

134
00:10:10,640 --> 00:10:16,630
screen is and make things Project perfectly across the screen in a grid system in the 3-D view.

135
00:10:16,730 --> 00:10:21,140
I would probably have done this in Spryte kit before I went and did it here in 3D and then just use

136
00:10:21,140 --> 00:10:22,430
2D images here.

137
00:10:22,490 --> 00:10:24,140
This is quite perfect where I want thanks.

138
00:10:24,140 --> 00:10:30,710
I just want the pyramid up even more so we are going to say point five on the pyramid and there's only

139
00:10:30,710 --> 00:10:37,340
three objects so I felt like it was reasonable just to place them here than to spend a whole hour coming

140
00:10:37,340 --> 00:10:41,640
up with an algorithm to put these in a grid.

141
00:10:41,990 --> 00:10:43,090
Just a decision.

142
00:10:43,130 --> 00:10:45,680
So it was a little bit higher.

143
00:10:45,680 --> 00:10:50,360
We're almost there ladies and gentlemen we say point four five.

144
00:10:50,420 --> 00:10:52,090
Run it again a little bit higher up

145
00:11:03,210 --> 00:11:04,560
click the secret button.

146
00:11:06,540 --> 00:11:07,940
And I'm going to work with this.

147
00:11:07,950 --> 00:11:09,320
This is good enough for me.

148
00:11:09,330 --> 00:11:14,040
So we're going to call this video done we've gotten three three objects here.

149
00:11:14,040 --> 00:11:16,690
It looks good and placed here strategically.

150
00:11:16,770 --> 00:11:23,950
So we can tap them and then place them on the market screen on this on the A-R a view.

151
00:11:24,060 --> 00:11:28,260
And this is cool so we're going to call this video done and the next video we're going to get these

152
00:11:28,260 --> 00:11:29,040
rotating.

153
00:11:29,040 --> 00:11:31,440
So they just have a little more life to them for working with 3-D.

154
00:11:31,440 --> 00:11:32,640
They might as well be moving.

155
00:11:32,640 --> 00:11:34,140
So that's it for now.

156
00:11:34,140 --> 00:11:35,580
Marc price at DEF slopes.

157
00:11:35,590 --> 00:11:37,840
Com see all soon.

