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