Coding Challenge #58: 3D Earthquake Data Visualization

Subscribers:
1,750,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