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