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

screenshot-01

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 solarsystemscope.com which provides the images free of charge for use in 3D models like this sketch.

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

Controls

(No interactivity implemented yet).

References:

Links: