class geom::UvSphereGenerator

Overview

Generator of UV sphere geometry. More…

#include <Procedural.h>

class UvSphereGenerator {
public:
    // construction

    UvSphereGenerator(uint32_t smoothness = 8);

    // methods

    std::vector<glm::vec3> GenVertices(const glm::vec3& center, float radius) const;
    std::vector<glm::uvec3> GenIndices() const;
};

Detailed Documentation

Generator of UV sphere geometry.

Construction

UvSphereGenerator(uint32_t smoothness = 8)

Construct generator. Higher values of smoothness parameter increase the vertex count.

Methods

std::vector<glm::vec3> GenVertices(const glm::vec3& center, float radius) const

Generates point positions for a specified sphere center and radius.

std::vector<glm::uvec3> GenIndices() const

Generates triangle indices defining point connectivity.