Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created June 24, 2013 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRayCode/5848499 to your computer and use it in GitHub Desktop.
Save AndrewRayCode/5848499 to your computer and use it in GitHub Desktop.
var texelMap = {
0: 3,
1: 1,
2: 0,
3: 2
};
for( fi = 0; faceVerts = uvMat[fi++]; ) {
for( vi = 0; vi < faceVerts.length; vi++ ) {
var pos = mesh.localToWorld(
mesh.geometry.vertices[ texelMap[ vi ] ].clone()
).multiplyScalar( tiling ).sub( mesh.position.clone().multiplyScalar( 2 * tiling ) );
faceVerts[ vi ] = new THREE.Vector2(
pos.x, pos.y
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment