Closed jpaoneMines closed 3 months ago
Half sphere: leverage full sphere but only draw half of it
// full sphere
glDrawArrays( GL_TRIANGLE_FAN, 0, static_cast<GLint>(slices+2) );
for(GLuint stackNum = 1; stackNum < stacks-1; stackNum++) {
glDrawArrays( GL_TRIANGLE_STRIP, static_cast<GLint>((slices+2) + (stackNum-1)*((slices+1)*2)), static_cast<GLint>((slices+1)*2) );
}
glDrawArrays( GL_TRIANGLE_FAN, static_cast<GLint>((slices+2) + (stacks-2)*(slices+1)*2), static_cast<GLint>(slices+2) );
// half sphere
//glDrawArrays( GL_TRIANGLE_FAN, 0, static_cast<GLint>(slices+2) );
for(GLuint stackNum = 1; stackNum < (stacks-1)/2; stackNum++) {
glDrawArrays( GL_TRIANGLE_STRIP, static_cast<GLint>((slices+2) + (stackNum-1)*((slices+1)*2)), static_cast<GLint>((slices+1)*2) );
}
glDrawArrays( GL_TRIANGLE_FAN, static_cast<GLint>((slices+2) + (stacks-2)*(slices+1)*2), static_cast<GLint>(slices+2) );
Flip definitions - half sphere has a cap, dome is open. dome can sit on top of a cylinder and be open all the way through
Done, ready for commit.
Commited.
Half sphere is an open shape.
Dome is a half sphere with a closed disc bottom.