From e0c97fbd1d088169af0601e053990dd518f9093a Mon Sep 17 00:00:00 2001 From: cuinjune Date: Fri, 6 Jan 2017 11:28:20 +0900 Subject: [PATCH] Changed sphere winding order from CCW to CW Sphere has an opposite winding order to other 3d primitives. This commit changes sphere winding order from CCW to CW. https://forum.openframeworks.cc/t/ofsphereprimitive-has-an-opposite-winding-order/25502 --- libs/openFrameworks/3d/ofMesh.inl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/openFrameworks/3d/ofMesh.inl b/libs/openFrameworks/3d/ofMesh.inl index 1d685105fad..079ea402480 100644 --- a/libs/openFrameworks/3d/ofMesh.inl +++ b/libs/openFrameworks/3d/ofMesh.inl @@ -1933,9 +1933,9 @@ ofMesh_ ofMesh_::sphere( float radius, int res, ofPrimitiveMod index2 = (iy+0) * (nr) + (ix+1); index3 = (iy+1) * (nr) + (ix+0); - mesh.addIndex(index1); - mesh.addIndex(index3); mesh.addIndex(index2); + mesh.addIndex(index3); + mesh.addIndex(index1); } if(iy < res-1 ) { @@ -1944,9 +1944,9 @@ ofMesh_ ofMesh_::sphere( float radius, int res, ofPrimitiveMod index2 = (iy+1) * (nr) + (ix+1); index3 = (iy+1) * (nr) + (ix+0); - mesh.addIndex(index1); - mesh.addIndex(index3); mesh.addIndex(index2); + mesh.addIndex(index3); + mesh.addIndex(index1); } }