Created
December 23, 2019 11:27
-
-
Save slawo-ch/e004af717a654f6e86e0fe977202736e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// offsets for moving height maps | |
let dx1 = 0; | |
let dy1 = 0; | |
let dx2 = 0; | |
let dy2 = 0; | |
// adjust height maps offsets | |
const moveHeightMaps = t => { | |
dx1 = Math.floor( | |
(((Math.cos(t * 0.0002 + 0.4 + Math.PI) + 1) / 2) * mapSize) / 2 | |
); | |
dy1 = Math.floor( | |
(((Math.cos(t * 0.0003 - 0.1) + 1) / 2) * mapSize) / 2 | |
); | |
dx2 = Math.floor( | |
(((Math.cos(t * -0.0002 + 1.2) + 1) / 2) * mapSize) / 2 | |
); | |
dy2 = Math.floor( | |
(((Math.cos(t * -0.0003 - 0.8 + Math.PI) + 1) / 2) * mapSize) / 2 | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment