0 1 00:00:00,630 --> 00:00:00,900 All right. 1 2 00:00:00,930 --> 00:00:02,740 So that was pretty simple, right. 2 3 00:00:02,800 --> 00:00:04,100 And that's all thanks to ARKit. 3 4 00:00:04,230 --> 00:00:07,610 So let's use it to create something else. Instead of using a cube, 4 5 00:00:07,650 --> 00:00:13,800 let's create a sphere this time. So we'll call it sphere. And instead of using SCNBox, there's something 5 6 00:00:13,800 --> 00:00:16,210 called SCNSphere. 6 7 00:00:16,410 --> 00:00:23,260 And all we have to do is give it a radius and let's say maybe 20 centimeters in radius. 7 8 00:00:23,280 --> 00:00:25,730 So that's about 40 centimeters in diameter. 8 9 00:00:25,740 --> 00:00:31,920 I think my room can handle that. And instead of adding the material to the cube, we'll add it to the sphere 9 10 00:00:31,950 --> 00:00:38,530 this time. And also change the geometry that's associated with the node to our new sphere. 10 11 00:00:38,760 --> 00:00:44,880 But this time, I want to make it a little bit fancier. Instead of just having the UIColor red which is 11 12 00:00:44,880 --> 00:00:46,750 nice enough if we're making a dice, 12 13 00:00:47,070 --> 00:00:48,210 but let's go crazy, 13 14 00:00:48,240 --> 00:00:50,950 let's put the moon into our living room. 14 15 00:00:51,150 --> 00:00:54,120 So even though it sounds pretty crazy, it's actually really easy to do. 15 16 00:00:54,300 --> 00:00:59,430 All we need is just a Texture map. And there's a website called solarsystemscope.com. 16 17 00:00:59,550 --> 00:01:06,690 And if you go into Textures, you'll see that they have loads of high-resolution images of a whole bunch 17 18 00:01:06,690 --> 00:01:14,380 of planets, Earth, or sun, moon, stars, Milky Way, and fictional. And you can download them for free. 18 19 00:01:14,400 --> 00:01:22,020 So in our case, we wanted the moon. And why go for high resolution, if you can go for extreme resolution? 19 20 00:01:22,020 --> 00:01:26,440 Well, obviously, if you're deploying the app into the App Store, you might want to make some considerations. 20 21 00:01:26,460 --> 00:01:31,490 But right now, I just want an extreme resolution moon in my living room. 21 22 00:01:31,680 --> 00:01:34,680 So I'm going to download this 8K file. 22 23 00:01:34,680 --> 00:01:34,890 All right. 23 24 00:01:34,920 --> 00:01:39,300 So once you've got it downloaded, you can actually see that this is just a flat map. 24 25 00:01:39,300 --> 00:01:42,240 It almost looks a bit like, you know, a world map 25 26 00:01:42,240 --> 00:01:47,770 if you had a picture of the earth. It's just the representation of a sphere laid down flat. 26 27 00:01:47,880 --> 00:01:53,970 And this is what we're going to use to essentially wrap around our sphere and make it look like as if 27 28 00:01:53,970 --> 00:01:56,580 we have a moon in our 3D space. 28 29 00:01:56,580 --> 00:01:58,840 So find that moon image that you downloaded. 29 30 00:01:58,860 --> 00:02:06,230 So I think it's called moon.jpg. And you're going to drag it into your art.scnassets folder. 30 31 00:02:06,270 --> 00:02:09,700 So just click and drag and there we go. 31 32 00:02:09,720 --> 00:02:10,700 It's incorporated. 32 33 00:02:11,430 --> 00:02:18,480 And then, instead of using UIColor, I'm going to show you how easy it is to add a Texture map to are 33 34 00:02:18,490 --> 00:02:19,530 3D object. 34 35 00:02:19,530 --> 00:02:25,740 So in this case, instead of having on diffuse property being a UIColor, I'm going to just use UIImage 35 36 00:02:26,130 --> 00:02:32,030 named. And remember that because it's resting inside the art.scnassets folder, 36 37 00:02:32,070 --> 00:02:34,730 it's actually not at the same hierarchy as our ViewController. 37 38 00:02:34,730 --> 00:02:39,780 So we're going to have to navigate into it, just like the way that they did here with the ship. 38 39 00:02:39,780 --> 00:02:45,600 So, in fact, I'm just going to copy that and paste that in. And instead of ship.scn, I'm going to 39 40 00:02:45,600 --> 00:02:48,090 change it to moon.jpg. 40 41 00:02:49,080 --> 00:02:56,400 So, now we are draping this moon.jpg Texture map onto our sphere, and we're going to place it at 41 42 00:02:56,400 --> 00:03:01,860 the same position as before with our box, and then we're going to make it appear on our sceneView. 42 43 00:03:02,040 --> 00:03:03,150 So let's give it a go. 43 44 00:03:21,150 --> 00:03:22,080 And there you have it, 44 45 00:03:22,080 --> 00:03:24,060 the moon in your living room. 45 46 00:03:24,210 --> 00:03:29,880 So I hope you enjoyed that, creating boxes, creating spheres, giving them Texture maps, giving them colors. 46 47 00:03:29,880 --> 00:03:36,000 Now in the next lesson, we're going to be getting on with our real task which is creating our 3D dice. 47 48 00:03:36,180 --> 00:03:41,460 And I'm going to show you how you can import other people's 3D models, so that you can easily use them in 48 49 00:03:41,460 --> 00:03:42,390 your project. 49 50 00:03:42,390 --> 00:03:43,110 So I'll see you there.