Kaynağa Gözat

fixed Cylinder uvs, renamed addTCoords to addUVs (close #525)

ncannasse 6 yıl önce
ebeveyn
işleme
2cf28d51a7
2 değiştirilmiş dosya ile 6 ekleme ve 6 silme
  1. 5 5
      h3d/prim/Cylinder.hx
  2. 1 1
      h3d/prim/Quads.hx

+ 5 - 5
h3d/prim/Cylinder.hx

@@ -22,15 +22,15 @@ class Cylinder extends Quads {
 		super(pts);
 	}
 
-	override public function addTCoords() {
+	override function addUVs() {
 		uvs = new Array();
 		for( s in 0...segs ) {
 			var u = s / segs;
 			var u2 = (s + 1) / segs;
-			uvs.push(new UV(u, 1));
-			uvs.push(new UV(u2, 1));
-			uvs.push(new UV(u, 0));
-			uvs.push(new UV(u2, 0));
+			uvs.push(new UV(1-u, 1));
+			uvs.push(new UV(1-u2, 1));
+			uvs.push(new UV(1-u, 0));
+			uvs.push(new UV(1-u2, 0));
 		}
 	}
 

+ 1 - 1
h3d/prim/Quads.hx

@@ -42,7 +42,7 @@ class Quads extends Primitive {
 	/**
 	* Warning : This will splice four basic uv value but can provoke aliasing problems.
 	*/
-	public function addTCoords() {
+	public function addUVs() {
 		uvs = [];
 		var a = new UV(0, 1);
 		var b = new UV(1, 1);