Skip to content

Commit

Permalink
fix: sphere points order #9
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJPinto committed Mar 1, 2024
1 parent 66676af commit ee10c8f
Show file tree
Hide file tree
Showing 2 changed files with 603 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generator/src/shapes/sphere.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ std::vector<Point> sphereTriangles(float radius, int slices, int stacks) {
float x4 = radius * std::sin(theta2) * std::sin(phi2);
float y4 = radius * std::cos(theta2);

// Push vertices in counter-clockwise order
points.push_back(Point(x1, y1, z1));
points.push_back(Point(x2, y2, z2));
points.push_back(Point(x4, y4, z4));
points.push_back(Point(x2, y2, z2));

// Second triangle
points.push_back(Point(x1, y1, z1));
points.push_back(Point(x4, y4, z4));
points.push_back(Point(x3, y3, z3));
points.push_back(Point(x4, y4, z4));
}
}

Expand Down
Loading

0 comments on commit ee10c8f

Please sign in to comment.