From 004773665a0a1015ed71136b2fbb1464a281714e Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Sat, 5 Nov 2011 11:14:10 +0100 Subject: [PATCH] Improved IcosahedronGeometry UVs This will need a rewrite anyway... --- src/extras/geometries/IcosahedronGeometry.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/extras/geometries/IcosahedronGeometry.js b/src/extras/geometries/IcosahedronGeometry.js index 1c7d1b0a49..f2780cbbea 100644 --- a/src/extras/geometries/IcosahedronGeometry.js +++ b/src/extras/geometries/IcosahedronGeometry.js @@ -107,9 +107,9 @@ THREE.IcosahedronGeometry = function ( subdivisions ) { inscope.faces.push( face ); inscope.faceVertexUvs[ 0 ].push( [ - new THREE.UV( Math.atan2( v1.z, v1.x ) / Math.PI, v1.y ), - new THREE.UV( Math.atan2( v2.z, v2.x ) / Math.PI, v2.y ), - new THREE.UV( Math.atan2( v3.z, v3.x ) / Math.PI, v3.y ) + new THREE.UV( 1 - ( ( ( Math.atan2( v1.z, v1.x ) + Math.PI ) % Math.PI ) / Math.PI * 0.5 ), 0.5 - v1.y / 2 ), + new THREE.UV( 1 - ( ( ( Math.atan2( v2.z, v2.x ) + Math.PI ) % Math.PI ) / Math.PI * 0.5 ), 0.5 - v2.y / 2 ), + new THREE.UV( 1 - ( ( ( Math.atan2( v3.z, v3.x ) + Math.PI ) % Math.PI ) / Math.PI * 0.5 ), 0.5 - v3.y / 2 ) ] ); } -- GitLab