Skip to content

Instantly share code, notes, and snippets.

// This function is based on the code found at (the original source doesn't work well)
// http://stackoverflow.com/questions/20774648/three-js-generate-uv-coordinate
//
// She following page explains how UV map should be calculated
// https://solutiondesign.com/blog/-/blogs/webgl-and-three-js-texture-mappi-1/
//
// The following documentation shows what a apherical UV map should look like
// https://threejs.org/examples/#misc_uv_tests
var ThreeUvMapper = {
// no NAF owernship verification, if someone else pick a balloon, you don't control it anymore
// to clean up after yourself
// for (var el of [...greenBaloons, ...blueBaloons]) el.remove()
resetVerticalPosition(blueBaloons)
upwardFloat(blueBaloons)
stopFloat(blueBaloons)
resetVerticalPosition(greenBaloons)