This app teaches kids about the solar system. It shows developers how the ARKit framework works. Here we first wrote a function. This function takes information about a radius, the texture to be used, and where the object will stand. If we take a closer look at the function, we first created a sphere using the SCNSphere class provided by ARKit. Then we created a variable with the SCNMaterial class as we will change the texture of the sphere we created. Then we placed the textures we got from the opengameart site with the diffuse.contents methods. After that, we gave this material to the sphere we created with the method of the material. Then we made this structure into a node. While taking the position of the node from the user, we also give the created sphere its geometry. Finally, we finish the function by adding this node to the root node. Then we call the function under viewDidLoad as much as the number of textures we have. After giving the values requested by the function, the process is completed. To make the planets look better, we set the automaticallyUpdatesLighting method to its true value.
muharremkoroglu / solar_system Goto Github PK
View Code? Open in Web Editor NEWUsing ARKit with Swift