Skip to content

Instantly share code, notes, and snippets.

@kishalmi
Created May 19, 2013 17:08
Show Gist options
  • Save kishalmi/5608286 to your computer and use it in GitHub Desktop.
Save kishalmi/5608286 to your computer and use it in GitHub Desktop.
invert UV.x of three.js geometry (if for example watching a textured sphere from the inside)
// invert U coordinate
for( var li in geometry.faceVertexUvs )
for( var fi in geometry.faceVertexUvs[li] )
for( var vi in geometry.faceVertexUvs[li][fi] )
geometry.faceVertexUvs[li][fi][vi].x = 1.0 - geometry.faceVertexUvs[li][fi][vi].x;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment