Created
August 3, 2023 14:45
-
-
Save Broxzier/9a0797a7922a1689f1ba6a3ff52400b3 to your computer and use it in GitHub Desktop.
A javascript function to quickly generate a grid of UV coordinates for an .obj file
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
function generateVT(w, h) { | |
var vt = ""; | |
for (var y = 1; y <= h; y++) | |
for (var x = 1; x <= w; x++) | |
vt += `vt ${((x-1)/(w-1)).toFixed(6)} ${((h-y)/(h-1)).toFixed(6)}\n`; | |
return vt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment