Browse Source

quick hack to fix subdivision example for lathegeometry as mergeVertices breaks the UVs..

zz85 13 years ago
parent
commit
57eecfd1b3
1 changed files with 6 additions and 2 deletions
  1. 6 2
      examples/webgl_geometry_subdivison.html

+ 6 - 2
examples/webgl_geometry_subdivison.html

@@ -23,6 +23,7 @@
 		<script src="../src/extras/geometries/CubeGeometry.js"></script>
 		<script src="../src/extras/geometries/CylinderGeometry.js"></script>
 		<script src="../src/extras/geometries/TorusGeometry.js"></script>
+		<script src="../src/extras/geometries/LatheGeometry.js"></script>
 		<script src="../src/extras/modifiers/SubdivisionModifier.js"></script>
 
 		<script src="fonts/helvetiker_regular.typeface.js"></script>
@@ -223,8 +224,11 @@
 				smooth = THREE.GeometryUtils.clone( geometry );
 
 				// mergeVertices(); is run in case of duplicated vertices
-				smooth.mergeVertices();
-				smooth.computeCentroids();
+				if (! (geometry instanceof THREE.LatheGeometry) ) {
+					smooth.mergeVertices();
+				}
+				
+				// smooth.computeCentroids();
 				// smooth.computeFaceNormals();
 				// smooth.computeVertexNormals();
 				modifier.modify( smooth );