Skip to content

Commit 6456390

Browse files
authored
Change Index Generation in LatheGeometry() (#23291)
LatheGeometry() produces bands of quads, each of which are further subdivided into an upper-right (blue) and a lower-left(green) triangle. The two triangles which are the result of quad subdivision, although different in shape and size, share common properties: Both comprise a horizontal edge, a slanted edge and a (shared) diagonal edge. The vertices of each triangle are specified in a CCW orientation. To facilitate further processing in an i.e. custom shader, it would be advantageous, if 1st and 2nd index always specify the horizontal edge, and 1st and 3rd vertex always specify the slanted edge. This is currently not the case. My proposed change involves a cyclical CCW rotation by one position of the indices of the upper-right triangle, in order to match the order already specified in the lower-left triangle. ==> b, c, d becomes c, d, b Note that the one-letter vertex "names" in the sketch match the variable names in source code.
1 parent 0c0d402 commit 6456390

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/geometries/LatheGeometry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class LatheGeometry extends BufferGeometry {
152152
// faces
153153

154154
indices.push( a, b, d );
155-
indices.push( b, c, d );
155+
indices.push( c, d, b );
156156

157157
}
158158

0 commit comments

Comments
 (0)