Coding Challenge #58: 3D Earthquake Data Visualization
In this coding challenge, I follow up on the Earthquake Data Visualization challenge and create a 3D version in Processing(Java) using spherical coordinates. I also discuss some 3D vector math including the cross product. Code: https://thecodingtrain.com/challenges/58-3d-earthquake-data-visualization
๐น๏ธ p5.js Web Editor Sketch: https://editor.p5js.org/codingtrain/sketches/tttPKxZi
๐ฅ Next video: https://youtu.be/4hA7G3gup-4?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
๐ฅ All videos: https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZiZxtDDRCi6uhfTH4FilpH
References:
๐ Spherical Coordinates System on Wikipedia: https://en.wikipedia.org/wiki/Spherical_coordinate_system
๐ USGS Earthquake Data: http://earthquake.usgs.gov/data/
๐ Cross Product Diagram: https://de.wikipedia.org/wiki/Kreuzprodukt#/media/File:Cross_product_parallelogram.svg
๐ Natural Earth Texture Maps: http://www.shadedrelief.com/natural3/pages/textures.html
๐ Nasa Earth Maps: http://visibleearth.nasa.gov/view_cat.php?categoryID=1484
๐ Euler Angle on Wikipedia: https://en.wikipedia.org/wiki/Euler_angles
๐ Quaternions and spatial rotation on Wikipedia: https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
Videos:
๐ฅ Earthquake Data Visualization: https://youtu.be/ZiYdOwOrGyc
Live Stream Archives:
๐ด Coding Train Live 77: https://youtu.be/L1nHni9HMBw
๐ด Coding Train Live 78: https://youtu.be/UiYb4yCsqFE
๐ด Coding Train Live 79: https://youtu.be/L1nHni9HMBw
Related Coding Challenges:
๐ #9 9-solar-system-3d-textures: https://youtu.be/FGAwi7wpU8c
๐ #25 Spherical Geometry: https://youtu.be/RkuBWEkBrZA
๐ #48 White House Social Media Data Visualization: https://youtu.be/UrznYJltZrU
๐ #109 Visualizing 500,000 Subscribers: https://youtu.be/Ae73YY_GAU8
Timestamps:
0:00 Introduce the coding challenge
1:59 Mention the previous coding challenge 'Earthquake Data Visualization'
2:59 Set up Processing environment with a 3D renderer
3:32 Draw a sphere
4:45 Add lights to shade the sphere
5:06 Rotate sphere around the y axis
5:58 Place a point with a fixed longitude and latitude
7:18 Convert longitude and latitude to an x and y location
8:00 Describe spherical coordinates
8:21 Find Cartesian coordinates
10:28 Draw a box
11:54 Load earthquake data
12:36 Describe `.csv` dataset
14:37 Parse data in a table
15:04 Loop through the rows of the table
15:55 Extract longitude, latitude and magnitude
17:15 Use coordinates to draw boxes
18:34 Add more data points
19:45 Describe how to draw boxes with a different height
22:20 Map the magnitude to the height of the boxes
23:29 Describe how to extrude boxes from the sphere
24:08 Implement vector math
26:47 Introduce cross product
29:11 Diagram cross product
29:37 Calculate rotation axis
30:06 Rotate boxes
31:55 Extrude boxes from the sphere
32:41 Re-introduce magnitude to size the boxes
33:04 Experiment with height values
33:35 Describe output and improvements
34:22 Find Earth texture from NASA reference
35:47 Load texture image
36:18 Add the texture to the sphere
38:12 Describe issue with the alignment of the texture
39:42 Conclude the coding challenge
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
#datavisualization #earthquakedata #3d #processing