This repository has been archived on 2024-12-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
2024CG-project-render/include/sphere.h
github-classroom[bot] 5985bb8445
Initial commit
2024-10-24 10:26:51 +00:00

29 lines
892 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef SPHERE_H
#define SPHERE_H
#include <Eigen/Core>
// Construct a quad mesh of a sphere wth num_faces_u × num_faces_v faces
// using a latitude-longitude Mercator parameterization.
//
// Inputs:
// num_faces_u number of faces in the longitudinal direction
// num_faces_v number of faces in the latitudinal direction
// Outputs:
// V #V by 3 list of 3D corner vertex positions
// F #F by 4 list of quad face indices into rows of V
// UV #UV by 2 list of corner parameterization positions
// UF #F by 4 list of quad face indices into rows of UV
// NV #NV by 3 list of 3D unit normal vectors
// NF #F by 4 list of quad face indices into rows of NV
void sphere(
const int num_faces_u,
const int num_faces_v,
Eigen::MatrixXd & V,
Eigen::MatrixXi & F,
Eigen::MatrixXd & UV,
Eigen::MatrixXi & UF,
Eigen::MatrixXd & NV,
Eigen::MatrixXi & NF);
#endif