Coding Challenge #58: 3D Earthquake Data Visualization

Subscribers:
1,740,000
Published on ● Video Link: https://www.youtube.com/watch?v=dbs4IYGfAXc



Duration: 40:37
61,791 views
1,183


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







Tags:
JavaScript (Programming Language)
live
programming
daniel shiffman
creative coding
p5.js
coding challenge
p5.js tutorial
p5js
javascript (programming language)
tutorial
javascript
coding
challenges
earthquake data
earthquake data viz
earthquake database
mapping earthquake data
latitude
longitude
mapping
3D data visualization
data visualization processing
cross product
sphere texture processing
sphere texture java
spherical coordinates