title
Coding Challenge #8: Solar System in Processing - Part 2 (3D)

description
In the second part of this coding challenge, using Processing, I take the code from the 2D Solar System and turn it three-dimensional. Code: https://thecodingtrain.com/challenges/8-solar-system-3d 🕹ī¸ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/QIB-sT10 đŸŽĨ Previous video: https://youtu.be/l8SiJ-RmeHU?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH đŸŽĨ Next video: https://youtu.be/FGAwi7wpU8c?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH đŸŽĨ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH References: 📹 PeasyCam library: http://mrfeinberg.com/peasycam/ Videos: 🔴 Coding Train Live 35: https://youtu.be/nF7DVmovWr0?t=1274s Related Coding Challenges: 🚂 #7 Solar System (2D): https://youtu.be/l8SiJ-RmeHU 🚂 #9 Solar System (3D) with textures: https://youtu.be/FGAwi7wpU8c Timestamps: 00:00 Introduction 00:25 Some improvements to the current version 02:33 Adding 3D 05:35 Visualising a 3D Solar System 09:05 Adding PeasyCam 12:40 Using Vector Cross Product to determine the axis of rotation 20:10 Adding more planets and moons Editing by Mathieu Blanchette Animations by Jason Heglund Music from Epidemic Sound 🚂 Website: http://thecodingtrain.com/ 👾 Share Your Creation! https://thecodingtrain.com/guides/passenger-showcase-guide 🚩 Suggest Topics: https://github.com/CodingTrain/Suggestion-Box 💡 GitHub: https://github.com/CodingTrain đŸ’Ŧ Discord: https://thecodingtrain.com/discord 💖 Membership: http://youtube.com/thecodingtrain/join 🛒 Store: https://standard.tv/codingtrain 🖋ī¸ Twitter: https://twitter.com/thecodingtrain 📸 Instagram: https://www.instagram.com/the.coding.train/ đŸŽĨ Coding Challenges: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH đŸŽĨ Intro to Programming: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6Zy51Q-x9tMWIv9cueOFTFA 🔗 p5.js: https://p5js.org 🔗 p5.js Web Editor: https://editor.p5js.org/ 🔗 Processing: https://processing.org 📄 Code of Conduct: https://github.com/CodingTrain/Code-of-Conduct This description was auto-generated. If you see a problem, please open an issue: https://github.com/CodingTrain/thecodingtrain.com/issues/new #solarsystem #3d #processing

detail
{'title': 'Coding Challenge #8: Solar System in Processing - Part 2 (3D)', 'heatmap': [{'end': 262.051, 'start': 237.557, 'weight': 0.869}, {'end': 445.286, 'start': 411.81, 'weight': 0.908}, {'end': 505.679, 'start': 478.124, 'weight': 0.76}, {'end': 612.039, 'start': 595.885, 'weight': 0.793}], 'summary': 'Tutorial series on processing covers the conversion from 2d to 3d solar system simulation, custom planetary orbits, 3d lighting techniques, planetary rotation, pzcam library usage for interactive mouse camera control, rotating planets around the sun using cross product, and creating a 3d nested solar system with moons orbiting planets.', 'chapters': [{'end': 257.689, 'segs': [{'end': 29.089, 'src': 'embed', 'start': 0.598, 'weight': 0, 'content': [{'end': 5.9, 'text': 'Welcome to part two of my solar system simulation generator thingamabob.', 'start': 0.598, 'duration': 5.302}, {'end': 8, 'text': 'So this has turned into a multi-part series.', 'start': 5.96, 'duration': 2.04}, {'end': 9.401, 'text': "I'm probably going to do one or two more.", 'start': 8.041, 'duration': 1.36}, {'end': 16.064, 'text': "But this part, what I'm going to do is take this 2D solar system orbiting thing and turn it into 3D.", 'start': 9.461, 'duration': 6.603}, {'end': 17.885, 'text': "So instead of circles, we're going to have spheres.", 'start': 16.123, 'duration': 1.762}, {'end': 24.527, 'text': "Instead of rotating just around in a two-dimensional plane, we're going to rotate in a three-dimensional space.", 'start': 18.185, 'duration': 6.342}, {'end': 29.089, 'text': 'So now, before I get to that, I want to make a couple small improvements here.', 'start': 24.927, 'duration': 4.162}], 'summary': 'Creating a 3d solar system simulation with spheres and 3d rotations.', 'duration': 28.491, 'max_score': 0.598, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw598.jpg'}, {'end': 64.443, 'src': 'embed', 'start': 36.912, 'weight': 1, 'content': [{'end': 42.335, 'text': 'So let me dive into the code real quick before I make this a 3D version and just go down to where that happens.', 'start': 36.912, 'duration': 5.423}, {'end': 43.475, 'text': 'That happens here.', 'start': 42.695, 'duration': 0.78}, {'end': 48.597, 'text': "Every time I make a new planet, it gets a radius that's based on the previous one.", 'start': 43.815, 'duration': 4.782}, {'end': 50.198, 'text': "They're shrinking, they're shrinking, they're shrinking.", 'start': 48.778, 'duration': 1.42}, {'end': 53.92, 'text': 'And it also gets a distance from the previous one, which is some random number.', 'start': 50.518, 'duration': 3.402}, {'end': 55.26, 'text': 'And this is what I could really improve.', 'start': 53.94, 'duration': 1.32}, {'end': 64.443, 'text': 'So, one thing that I want to do is say OK, the distance, if I wanted it to be perfect, right, I lost my.', 'start': 55.661, 'duration': 8.782}], 'summary': 'Code generates shrinking 3d planets with random distances, seeking improvement.', 'duration': 27.531, 'max_score': 36.912, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw36912.jpg'}, {'end': 236.337, 'src': 'embed', 'start': 145.374, 'weight': 2, 'content': [{'end': 153.057, 'text': 'So the planets will orbit somewhere between being exactly touching the original planet, orbiting the thing, and a little further away.', 'start': 145.374, 'duration': 7.683}, {'end': 155.459, 'text': 'Okay, so here we go.', 'start': 153.357, 'duration': 2.102}, {'end': 159.983, 'text': "Okay, so now we can see, I don't know, I just kind of like how this looks better.", 'start': 156.84, 'duration': 3.143}, {'end': 167.83, 'text': "Everything has kind of a more thoughtful spacing, and I don't know if the ratio of the sizes is good, but we can worry about that stuff later,", 'start': 160.023, 'duration': 7.807}, {'end': 170.773, 'text': 'because what I really want to focus on is moving to 3D.', 'start': 167.83, 'duration': 2.943}, {'end': 172.775, 'text': 'Okay, exciting.', 'start': 171.254, 'duration': 1.521}, {'end': 176.218, 'text': "Now is the time, three minutes into this video, we're going to add 3D.", 'start': 173.155, 'duration': 3.063}, {'end': 185.723, 'text': "So the first thing I'm going to do to add 3D This is going to be a magical thing, is I'm just going to go here, and I'm going to say 600, 600, p3d.", 'start': 176.238, 'duration': 9.485}, {'end': 189.545, 'text': '3D solar system.', 'start': 188.624, 'duration': 0.921}, {'end': 190.025, 'text': 'There you go.', 'start': 189.625, 'duration': 0.4}, {'end': 195.167, 'text': "So this is actually now rendering in 3D using Processing's 3D renderer.", 'start': 190.265, 'duration': 4.902}, {'end': 200.47, 'text': "But of course, I'm still just drawing circles, and I'm still just placing everything along that two-dimensional plane.", 'start': 195.348, 'duration': 5.122}, {'end': 203.651, 'text': 'But it is important to note that processing.', 'start': 200.71, 'duration': 2.941}, {'end': 209.173, 'text': 'one of the reasons I like to use processing is that it lets you sort of blend and blur the lines between 2D and 3D.', 'start': 203.651, 'duration': 5.522}, {'end': 211.133, 'text': 'It gives all the 2D drawing stuff in 3D.', 'start': 209.193, 'duration': 1.94}, {'end': 218.015, 'text': "But let's look a little more carefully at this and start going, making this even more 3D.", 'start': 211.433, 'duration': 6.582}, {'end': 224.896, 'text': 'So first thing I could do to make this more 3D is instead of drawing an ellipse, I could draw a sphere.', 'start': 218.375, 'duration': 6.521}, {'end': 234.716, 'text': 'So the function to draw a sphere in processing is just the word sphere and then sphere takes a Diameter or radius?', 'start': 225.376, 'duration': 9.34}, {'end': 235.496, 'text': "I'm not really sure.", 'start': 234.756, 'duration': 0.74}, {'end': 236.337, 'text': "let's try radius.", 'start': 235.496, 'duration': 0.841}], 'summary': 'The transcript discusses transitioning from 2d to 3d rendering using processing, experimenting with different visual effects and exploring the potential of blending 2d and 3d.', 'duration': 90.963, 'max_score': 145.374, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw145374.jpg'}], 'start': 0.598, 'title': 'Solar system simulation and 3d rendering', 'summary': 'Covers the conversion from 2d to 3d solar system simulation, custom planetary orbits, and transitioning to 3d rendering in processing, emphasizing the calculation of planet sizes and distances, adjusting random distances between planets, and exploring 3d rendering techniques.', 'chapters': [{'end': 102.607, 'start': 0.598, 'title': 'Converting 2d solar system to 3d', 'summary': 'Discusses the process of converting a 2d solar system simulation into a 3d simulation by introducing spheres and making small improvements to the code, emphasizing the calculation of planet sizes and distances.', 'duration': 102.009, 'highlights': ['The process of converting a 2D solar system simulation into a 3D simulation by introducing spheres and making small improvements to the code. The discussion revolves around the transition from a 2D to a 3D solar system simulation and the introduction of spheres for representation.', 'Emphasizing the calculation of planet sizes and distances for small improvements to the code. The importance of being thoughtful in determining the sizes and distances of the planets in the simulation is emphasized for enhancing the code.']}, {'end': 167.83, 'start': 103.752, 'title': 'Custom planetary orbits', 'summary': 'Illustrates the process of creating custom planetary orbits, adjusting random distances between planets to achieve a more thoughtful spacing and interesting patterns, and experimenting with different sizes and ratios.', 'duration': 64.078, 'highlights': ['The planets will orbit somewhere between being exactly touching the original planet, orbiting the thing, and a little further away.', 'Adjusting random distances between planets to achieve a more thoughtful spacing and interesting patterns.', 'Experimenting with different sizes and ratios.']}, {'end': 257.689, 'start': 167.83, 'title': 'Transitioning to 3d rendering in processing', 'summary': "Discusses the transition to 3d rendering in processing, with the addition of 3d at three minutes into the video, rendering in 3d using processing's 3d renderer, and the exploration of drawing spheres instead of ellipses to achieve a more 3d effect.", 'duration': 89.859, 'highlights': ["The chapter discusses the transition to 3D rendering in Processing, with the addition of 3D at three minutes into the video, rendering in 3D using Processing's 3D renderer, and the exploration of drawing spheres instead of ellipses to achieve a more 3D effect.", 'Processing allows blending and blurring of the lines between 2D and 3D, providing 2D drawing capabilities in 3D.', 'The function to draw a sphere in Processing is introduced, with a discussion on specifying the diameter or radius and the visual differences between an ellipse and a sphere.']}], 'duration': 257.091, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw598.jpg', 'highlights': ['The process of converting a 2D solar system simulation into a 3D simulation by introducing spheres and making small improvements to the code.', 'Emphasizing the calculation of planet sizes and distances for small improvements to the code.', 'Adjusting random distances between planets to achieve a more thoughtful spacing and interesting patterns.', 'Experimenting with different sizes and ratios.', "The chapter discusses the transition to 3D rendering in Processing, with the addition of 3D at three minutes into the video, rendering in 3D using Processing's 3D renderer, and the exploration of drawing spheres instead of ellipses to achieve a more 3D effect.", 'Processing allows blending and blurring of the lines between 2D and 3D, providing 2D drawing capabilities in 3D.', 'The function to draw a sphere in Processing is introduced, with a discussion on specifying the diameter or radius and the visual differences between an ellipse and a sphere.']}, {'end': 566.669, 'segs': [{'end': 354.811, 'src': 'embed', 'start': 324.932, 'weight': 0, 'content': [{'end': 326.072, 'text': "And you'll see what that's going to do.", 'start': 324.932, 'duration': 1.14}, {'end': 329.594, 'text': 'So now we can see that now this has the appearance.', 'start': 326.852, 'duration': 2.742}, {'end': 331.135, 'text': 'They have the appearance more of spheres.', 'start': 329.614, 'duration': 1.521}, {'end': 334.678, 'text': "It's very subtle, but there's some shadowing on the spheres based on the lights.", 'start': 331.175, 'duration': 3.503}, {'end': 337.199, 'text': "Now, this is almost like, hey, we're done.", 'start': 334.958, 'duration': 2.241}, {'end': 340.301, 'text': 'I made this simulation in 3D.', 'start': 337.219, 'duration': 3.082}, {'end': 342.543, 'text': 'Look And in a way, it looks kind of 3D.', 'start': 340.782, 'duration': 1.761}, {'end': 345.345, 'text': 'And I could add some camera work and do some other things.', 'start': 342.583, 'duration': 2.762}, {'end': 348.747, 'text': 'But everything is actually happening all on one plane.', 'start': 345.465, 'duration': 3.282}, {'end': 354.811, 'text': "And what I want to do, and I'm going to try to draw a diagram here just to kind of work this out in my head.", 'start': 349.108, 'duration': 5.703}], 'summary': '3d simulation with sphere appearance and subtle shadowing, all on one plane.', 'duration': 29.879, 'max_score': 324.932, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw324932.jpg'}, {'end': 394.917, 'src': 'embed', 'start': 367.138, 'weight': 1, 'content': [{'end': 370.96, 'text': "I'm just trying to create something that looks kind of interesting and figure out how stuff works in processing.", 'start': 367.138, 'duration': 3.822}, {'end': 381.207, 'text': 'But I want to arbitrarily create a vector out from a particular planet and create another planet and then maybe rotate around the planet.', 'start': 371.441, 'duration': 9.766}, {'end': 383.249, 'text': 'So there would be all of this would happen.', 'start': 381.247, 'duration': 2.002}, {'end': 388.813, 'text': "I'm drawing in two dimensional space, so it's very hard to do and I have no artistic talent whatsoever, so I can't even really draw this well.", 'start': 383.249, 'duration': 5.564}, {'end': 394.917, 'text': 'But you can sort of imagine, I want to arbitrarily place a planet out here and have it rotate like this or one out here and have it rotate like this.', 'start': 389.033, 'duration': 5.884}], 'summary': 'Creating a processing project to rotate planets in 2d space.', 'duration': 27.779, 'max_score': 367.138, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw367138.jpg'}, {'end': 445.286, 'src': 'heatmap', 'start': 411.81, 'weight': 0.908, 'content': [{'end': 416.252, 'text': "I'm going to call it v, just for lack of anything else that I can think of right now.", 'start': 411.81, 'duration': 4.442}, {'end': 421.233, 'text': "I'm going to say v equals pvector.random3d.", 'start': 416.652, 'duration': 4.581}, {'end': 425.374, 'text': "So this here is a particular, oh boy, I'm not in the right place.", 'start': 421.733, 'duration': 3.641}, {'end': 426.294, 'text': 'Sorry, everybody.', 'start': 425.574, 'duration': 0.72}, {'end': 429.775, 'text': "That was a little awkward moment there, but I don't know.", 'start': 427.474, 'duration': 2.301}, {'end': 434.438, 'text': 'Maybe some CGI magic can fix that someday.', 'start': 430.715, 'duration': 3.723}, {'end': 440.102, 'text': 'So what I created here is a random 3D vector.', 'start': 435.199, 'duration': 4.903}, {'end': 445.286, 'text': 'So any vector pointing in space that is of length 1.', 'start': 440.162, 'duration': 5.124}], 'summary': 'Using pvector.random3d to create a random 3d vector of length 1.', 'duration': 33.476, 'max_score': 411.81, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw411810.jpg'}, {'end': 505.679, 'src': 'heatmap', 'start': 478.124, 'weight': 0.76, 'content': [{'end': 483.161, 'text': "Okay, so then when I'm drawing it, Let's look down here.", 'start': 478.124, 'duration': 5.037}, {'end': 488.745, 'text': "I don't want to translate simply along the x-axis by some distance like I did in 2D.", 'start': 483.261, 'duration': 5.484}, {'end': 493.629, 'text': 'I want to translate by that vector, v.x, v.y, v.z.', 'start': 489.246, 'duration': 4.383}, {'end': 498.353, 'text': "And what I'm going to do here is I'm going to take out rotation for right now and just translate.", 'start': 494.01, 'duration': 4.343}, {'end': 501.175, 'text': "And we can see what's going on here.", 'start': 499.454, 'duration': 1.721}, {'end': 504.038, 'text': 'And you can see that there are a bunch of spheres.', 'start': 501.476, 'duration': 2.562}, {'end': 505.679, 'text': 'And let me fix a few things.', 'start': 504.118, 'duration': 1.561}], 'summary': 'Demonstration of 3d translation with vector v.x, v.y, v.z', 'duration': 27.555, 'max_score': 478.124, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw478124.jpg'}, {'end': 550.032, 'src': 'embed', 'start': 512.972, 'weight': 2, 'content': [{'end': 519.777, 'text': 'Number one is, if you recall, the planets are picking a random number of moons.', 'start': 512.972, 'duration': 6.805}, {'end': 521.958, 'text': 'So I want to just change that to one.', 'start': 520.158, 'duration': 1.8}, {'end': 524.179, 'text': 'So every planet just has one moon.', 'start': 522.359, 'duration': 1.82}, {'end': 527.142, 'text': "And I'm also going to have fewer levels.", 'start': 524.24, 'duration': 2.902}, {'end': 542.585, 'text': 'So we can see now that when I run this, whoops, what happened here? Okay, wait, pause, time out, time out.', 'start': 527.542, 'duration': 15.043}, {'end': 550.032, 'text': 'Oops, so I forgot that in the original sun.', 'start': 545.588, 'duration': 4.444}], 'summary': 'Change planets to have one moon and reduce levels.', 'duration': 37.06, 'max_score': 512.972, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw512972.jpg'}], 'start': 258.089, 'title': '3d lighting and planetary rotation', 'summary': 'Covers the concept of 3d lighting, showcasing the transformation of shapes into a 3d appearance and discusses creating 3d planetary rotation using random vectors and scaling by distance, aiming to understand processing.', 'chapters': [{'end': 345.345, 'start': 258.089, 'title': 'Introduction to 3d lighting', 'summary': "Explores the concept of 3d lighting, demonstrating the transformation of simple shapes into a 3d appearance using the 'lights' function, resulting in subtle shadowing effects and enhanced depth perception.", 'duration': 87.256, 'highlights': ["The concept of 3D lighting is introduced, utilizing the 'lights' function to add a wash of light into the scene, resulting in the subtle shadowing on the spheres based on the lights.", 'The demonstration emphasizes the transformation of simple shapes into a 3D appearance by adding generic lighting effects, enhancing depth perception and creating a more realistic visual representation.']}, {'end': 566.669, 'start': 345.465, 'title': 'Creating 3d planetary rotation', 'summary': 'Discusses the process of arbitrarily creating 3d planetary rotation using random vectors and scaling by distance, aiming to understand how stuff works in processing.', 'duration': 221.204, 'highlights': ['Creating random 3D vectors and scaling by distance to arbitrarily place and rotate planets, aiming to understand 3D planetary rotation in processing.', 'Adjusting the number of moons for each planet and reducing the number of levels to simplify the visualization process, allowing for easier comprehension of the planetary system.', 'Demonstrating the translation of planets in 3D space using vectors and addressing initial issues related to the number of moons around the original planet.']}], 'duration': 308.58, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw258089.jpg', 'highlights': ['The demonstration emphasizes the transformation of simple shapes into a 3D appearance by adding generic lighting effects, enhancing depth perception and creating a more realistic visual representation.', 'Creating random 3D vectors and scaling by distance to arbitrarily place and rotate planets, aiming to understand 3D planetary rotation in processing.', 'Adjusting the number of moons for each planet and reducing the number of levels to simplify the visualization process, allowing for easier comprehension of the planetary system.']}, {'end': 742.31, 'segs': [{'end': 626.624, 'src': 'heatmap', 'start': 595.885, 'weight': 0.793, 'content': [{'end': 596.606, 'text': "So I've already done that.", 'start': 595.885, 'duration': 0.721}, {'end': 604.232, 'text': "I don't know when I did that, but, by the way, what you'll need to do is here go to add library search for PZCam,", 'start': 596.606, 'duration': 7.626}, {'end': 612.039, 'text': "click this and then you'll be able to click install so that it's installed, and then you shouldn't need to restart processing.", 'start': 604.232, 'duration': 7.807}, {'end': 614.201, 'text': 'but if you run into any issues, just restart processing.', 'start': 612.039, 'duration': 2.162}, {'end': 617.384, 'text': 'Okay, so once you have PZCam installed,', 'start': 614.281, 'duration': 3.103}, {'end': 626.624, 'text': 'I can do sketch import library and just select here PZCam And you can see it added some import statements to the top,', 'start': 617.384, 'duration': 9.24}], 'summary': 'Instructions for installing pzcam library and importing it into sketch.', 'duration': 30.739, 'max_score': 595.885, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw595885.jpg'}, {'end': 655.379, 'src': 'embed', 'start': 626.624, 'weight': 0, 'content': [{'end': 632.925, 'text': "a library being something that allows you to bring in additional code that's not part of core processing to call automatic functions.", 'start': 626.624, 'duration': 6.301}, {'end': 638.987, 'text': 'And what PZCam does is it automatically adds interactive mouse camera work to your 3D thing.', 'start': 633.005, 'duration': 5.982}, {'end': 646.508, 'text': "So then all I need to do is create a PZCam, or maybe it's just a PZObject.", 'start': 639.387, 'duration': 7.121}, {'end': 648.269, 'text': 'No, PZCamObject.', 'start': 647.008, 'duration': 1.261}, {'end': 652.217, 'text': 'No What is it called? Oh, PZCam.', 'start': 649.009, 'duration': 3.208}, {'end': 653.538, 'text': 'There we go.', 'start': 652.717, 'duration': 0.821}, {'end': 655.379, 'text': 'PZCam object called cam.', 'start': 653.778, 'duration': 1.601}], 'summary': 'Pzcam adds interactive mouse camera work to 3d objects.', 'duration': 28.755, 'max_score': 626.624, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw626624.jpg'}], 'start': 566.949, 'title': 'Adding pzcam to 3d visualization', 'summary': 'Discusses the installation process and usage of the pzcam library to enable interactive mouse camera control for 3d visualization, emphasizing its role in adjusting camera position and view.', 'chapters': [{'end': 742.31, 'start': 566.949, 'title': 'Adding pzcam to 3d visualization', 'summary': 'Discusses adding the pzcam library to enable interactive mouse camera control for 3d visualization, emphasizing the installation process and demonstrating its usage in adjusting camera position and view.', 'duration': 175.361, 'highlights': ['The PZCam library is used to add interactive mouse camera control to 3D visualization. The PZCam library allows for interactive mouse camera work to be added to 3D visualization, enabling easier manipulation and understanding of the visual elements.', 'Demonstration of the installation process for the PZCam library is provided, including the steps for adding and installing the library in Processing. The process of adding and installing the PZCam library in Processing is highlighted, guiding users through the necessary steps to incorporate the library for enhanced 3D visualization.', 'Usage of PZCam for adjusting camera position and view is exemplified, showcasing the ease of controlling the 3D perspective and demonstrating the impact on visual elements such as shadowing. The use of PZCam to adjust the camera position and view in 3D visualization is demonstrated, illustrating its impact on the visual representation, including adjustments to camera distance and the resulting changes in shadowing.']}], 'duration': 175.361, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw566949.jpg', 'highlights': ['The PZCam library allows for interactive mouse camera work to be added to 3D visualization, enabling easier manipulation and understanding of the visual elements.', 'The process of adding and installing the PZCam library in Processing is highlighted, guiding users through the necessary steps to incorporate the library for enhanced 3D visualization.', 'The use of PZCam to adjust the camera position and view in 3D visualization is demonstrated, illustrating its impact on the visual representation, including adjustments to camera distance and the resulting changes in shadowing.']}, {'end': 1123.694, 'segs': [{'end': 816.624, 'src': 'embed', 'start': 788.806, 'weight': 0, 'content': [{'end': 796.049, 'text': 'The cross product of two vectors is this, a vector that is perpendicular to both of those vectors.', 'start': 788.806, 'duration': 7.243}, {'end': 802.591, 'text': 'So if these were my vectors, I would still also get this particular vector.', 'start': 796.449, 'duration': 6.142}, {'end': 806.753, 'text': 'So the reason why I want to do that is, remember, this is the sun.', 'start': 803.011, 'duration': 3.742}, {'end': 811.061, 'text': 'This is the vector where my moon is.', 'start': 808.14, 'duration': 2.921}, {'end': 816.624, 'text': 'And what I want, essentially, is for that vector to rotate around the sun like this.', 'start': 811.442, 'duration': 5.182}], 'summary': 'Cross product yields perpendicular vector, enabling rotation around sun.', 'duration': 27.818, 'max_score': 788.806, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw788806.jpg'}, {'end': 964.487, 'src': 'embed', 'start': 940.029, 'weight': 1, 'content': [{'end': 945.653, 'text': 'p, the cross product of v, the vector that is actually coming out from this planet to where?', 'start': 940.029, 'duration': 5.624}, {'end': 948.115, 'text': 'out from the sun, to where this planet should be.', 'start': 945.653, 'duration': 2.462}, {'end': 952.038, 'text': "and now I've got some perpendicular vector and now I can use something here.", 'start': 948.115, 'duration': 3.923}, {'end': 955.441, 'text': "I can use Processing's rotate function.", 'start': 953.3, 'duration': 2.141}, {'end': 960.304, 'text': 'In 3D, you can say an arbitrary axis I want to rotate around.', 'start': 955.982, 'duration': 4.322}, {'end': 964.487, 'text': 'So if this is the x-axis, rotating around the x-axis would be like this.', 'start': 960.544, 'duration': 3.943}], 'summary': 'Using cross product and rotate function in processing for 3d vector manipulation.', 'duration': 24.458, 'max_score': 940.029, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw940029.jpg'}, {'end': 1126.976, 'src': 'embed', 'start': 1104.042, 'weight': 2, 'content': [{'end': 1112.408, 'text': "So this is just a quick and dirty way to get a sphere arbitrarily rotating around another sphere at some arbitrary axis that's random.", 'start': 1104.042, 'duration': 8.366}, {'end': 1116.25, 'text': 'So again, you might have some other algorithm by which you want to calculate this stuff.', 'start': 1112.708, 'duration': 3.542}, {'end': 1120.452, 'text': 'And the cross product that I picked is just some arbitrary vector.', 'start': 1116.63, 'duration': 3.822}, {'end': 1122.774, 'text': 'I probably could be more thoughtful about that.', 'start': 1120.773, 'duration': 2.001}, {'end': 1123.694, 'text': 'But this works.', 'start': 1122.994, 'duration': 0.7}, {'end': 1126.976, 'text': 'So now we can start doing a couple of things.', 'start': 1124.535, 'duration': 2.441}], 'summary': 'A quick and dirty method for rotating one sphere around another at a random axis is discussed, with room for improvement.', 'duration': 22.934, 'max_score': 1104.042, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw1104042.jpg'}], 'start': 742.31, 'title': 'Rotating planet around sun', 'summary': 'Discusses using the cross product to create a perpendicular vector for rotating a planet around the sun, achieving the desired orbit.', 'chapters': [{'end': 1123.694, 'start': 742.31, 'title': 'Rotating planet around sun', 'summary': 'Discusses using the cross product to create a perpendicular vector for rotating a planet around the sun, achieving the desired orbit.', 'duration': 381.384, 'highlights': ['The cross product is used to create a vector that is perpendicular to both the sun and the vector where the moon is, enabling the moon to rotate around the sun. The cross product is employed to generate a perpendicular vector, allowing the moon to rotate around the sun.', "The perpendicular vector is utilized with Processing's rotate function, enabling the planet to orbit around the sun at an arbitrary axis. The perpendicular vector, obtained using the cross product, is used with Processing's rotate function to achieve the desired orbit around the sun.", 'The chapter provides a quick and dirty way to get a sphere arbitrarily rotating around another sphere at some arbitrary axis using the described method. The method described offers a quick and simple approach to achieve arbitrary rotation of a sphere around another sphere at a random axis.']}], 'duration': 381.384, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw742310.jpg', 'highlights': ['The cross product is used to create a vector that is perpendicular to both the sun and the vector where the moon is, enabling the moon to rotate around the sun.', "The perpendicular vector is utilized with Processing's rotate function, enabling the planet to orbit around the sun at an arbitrary axis.", 'The chapter provides a quick and dirty way to get a sphere arbitrarily rotating around another sphere at some arbitrary axis using the described method.']}, {'end': 1294.374, 'segs': [{'end': 1294.374, 'src': 'embed', 'start': 1233.423, 'weight': 0, 'content': [{'end': 1244.347, 'text': "And then I can also let's give it four to start with, and then let's also allow them, when they create their moons, to do what?", 'start': 1233.423, 'duration': 10.924}, {'end': 1249.369, 'text': "To have a random number between zero, let's not give them too many and two.", 'start': 1244.788, 'duration': 4.581}, {'end': 1252.35, 'text': "So we can see now, look what we've got here.", 'start': 1250.569, 'duration': 1.781}, {'end': 1261.833, 'text': "We've got a nice system of many planets orbiting other planets, everything's spaced out, and everything's at random angles along random axes.", 'start': 1252.57, 'duration': 9.263}, {'end': 1270.017, 'text': 'So hopefully this gives you the idea of how to get started with creating a three-dimensional sort of nested solar system,', 'start': 1262.133, 'duration': 7.884}, {'end': 1276.121, 'text': 'where you have a sphere with spheres rotating around it, with other spheres rotating around it and with other spheres rotating around it.', 'start': 1270.017, 'duration': 6.104}, {'end': 1280.004, 'text': "And this code, if you look in the description of this video, you'll find the code for this.", 'start': 1276.181, 'duration': 3.823}, {'end': 1284.467, 'text': "And what I'm going to do in part three is I'm going to add textures to these planets.", 'start': 1280.084, 'duration': 4.383}, {'end': 1292.432, 'text': "So I'm going to show you how you can draw the spheres with other textures and maybe put a background or something else like that to make it feel more spacey.", 'start': 1284.787, 'duration': 7.645}, {'end': 1294.374, 'text': 'OK? Thanks for watching.', 'start': 1293.233, 'duration': 1.141}], 'summary': 'Demonstrates creating a 3d nested solar system with random number generation and textures, code provided in video description.', 'duration': 60.951, 'max_score': 1233.423, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw1233423.jpg'}], 'start': 1124.535, 'title': '3d nested solar system', 'summary': 'Demonstrates the process of creating a 3d nested solar system, allowing each planet to have a specified number of moons orbiting it, resulting in a system of many planets orbiting other planets, spaced out at random angles along random axes.', 'chapters': [{'end': 1294.374, 'start': 1124.535, 'title': 'Creating a 3d nested solar system', 'summary': 'Demonstrates the process of creating a 3d nested solar system, allowing each planet to have a specified number of moons orbiting it, resulting in a system of many planets orbiting other planets, spaced out at random angles along random axes.', 'duration': 169.839, 'highlights': ['The chapter demonstrates the process of creating a 3D nested solar system, allowing each planet to have a specified number of moons orbiting it, resulting in a system of many planets orbiting other planets, spaced out at random angles along random axes.', 'The code for creating this 3D nested solar system is provided in the description of the video.', 'The next part of the demonstration will involve adding textures to the planets, along with potentially adding a background to enhance the spacey feel.']}], 'duration': 169.839, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/dncudkelNxw/pics/dncudkelNxw1124535.jpg', 'highlights': ['The chapter demonstrates the process of creating a 3D nested solar system, allowing each planet to have a specified number of moons orbiting it, resulting in a system of many planets orbiting other planets, spaced out at random angles along random axes.', 'The code for creating this 3D nested solar system is provided in the description of the video.', 'The next part of the demonstration will involve adding textures to the planets, along with potentially adding a background to enhance the spacey feel.']}], 'highlights': ['The process of converting a 2D solar system simulation into a 3D simulation by introducing spheres and making small improvements to the code.', 'The demonstration emphasizes the transformation of simple shapes into a 3D appearance by adding generic lighting effects, enhancing depth perception and creating a more realistic visual representation.', 'The PZCam library allows for interactive mouse camera work to be added to 3D visualization, enabling easier manipulation and understanding of the visual elements.', 'The cross product is used to create a vector that is perpendicular to both the sun and the vector where the moon is, enabling the moon to rotate around the sun.', 'The chapter demonstrates the process of creating a 3D nested solar system, allowing each planet to have a specified number of moons orbiting it, resulting in a system of many planets orbiting other planets, spaced out at random angles along random axes.']}