This is a p5.js sketch inspired by the Coding Train’s Coding Challenge #9 on applying textures to the 3D solar system.


Built off of the Solar System 3D sketch.

Key learnings:

  • The preload() p5.js function allows for easy preloading of assets (eg. image files) to make sure they are available by the time setup() runs.
    • This is helpful, since the textures total 5.3 MB.
  • The texture() p5.js function allows for wrapping an image around the next 3D primitive drawn.

Sample Textures:

Textures were downloaded from which provides the images free of charge for use in 3D models like this sketch.

texture-sample-sun texture-sample-earth texture-sample-jupiter


(No interactivity implemented yet).