1. Michael Ludwig
  2. ferox

Commits

Michael Ludwig  committed 6697db6

Correct winding in rectangle triangle strip

  • Participants
  • Parent commits bfdc429
  • Branches default

Comments (0)

Files changed (1)

File ferox-renderer/src/main/java/com/ferox/renderer/geom/RectangleImpl.java

View file
  • Ignore whitespace
         va[i++] = (float) xAxis.z;
         va[i++] = 1.0f;
 
+        // upper-right
+        va[i++] = (float) (xAxis.x * right + yAxis.x * top);
+        va[i++] = (float) (xAxis.y * right + yAxis.y * top);
+        va[i++] = (float) (xAxis.z * right + yAxis.z * top);
+
+        va[i++] = (float) normal.x;
+        va[i++] = (float) normal.y;
+        va[i++] = (float) normal.z;
+
+        va[i++] = 1f;
+        va[i++] = 1f;
+
+        va[i++] = (float) xAxis.x;
+        va[i++] = (float) xAxis.y;
+        va[i++] = (float) xAxis.z;
+        va[i++] = 1.0f;
+
         // lower-right
         va[i++] = (float) (xAxis.x * right + yAxis.x * bottom);
         va[i++] = (float) (xAxis.y * right + yAxis.y * bottom);
         va[i++] = (float) xAxis.z;
         va[i++] = 1.0f;
 
-        // upper-right
-        va[i++] = (float) (xAxis.x * right + yAxis.x * top);
-        va[i++] = (float) (xAxis.y * right + yAxis.y * top);
-        va[i++] = (float) (xAxis.z * right + yAxis.z * top);
-
-        va[i++] = (float) normal.x;
-        va[i++] = (float) normal.y;
-        va[i++] = (float) normal.z;
-
-        va[i++] = 1f;
-        va[i++] = 1f;
-
-        va[i++] = (float) xAxis.x;
-        va[i++] = (float) xAxis.y;
-        va[i++] = (float) xAxis.z;
-        va[i++] = 1.0f;
-
         vertexAttributes = framework.newVertexBuffer().from(va).build();
         vertices = new VertexAttribute(vertexAttributes, 3, 0, 9);
         normals = new VertexAttribute(vertexAttributes, 3, 3, 9);