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/write_obj.h
github-classroom[bot] 5985bb8445
Initial commit
2024-10-24 10:26:51 +00:00

24 lines
740 B
C++

#ifndef WRITE_OBJ_H
#define WRITE_OBJ_H
#include <Eigen/Core>
#include <string>
// Write a triangle or quad mesh to a .obj file
//
// Inputs:
// filename path to .obj file
// V #V by 3 list of vertex positions
// F #F by poly=(3 or 4) list of mesh face indices into V
// UV #UV by 2 list of UV positions
// UF #F by poly list of mesh face indices into UV
// NV #NV by 3 list of normal vectors
// NF #F by poly list of mesh face indices into NV
// Returns true if write was successful
bool write_obj(
const std::string & filename,
const Eigen::MatrixXd & V,
const Eigen::MatrixXi & F,
const Eigen::MatrixXd & UV,
const Eigen::MatrixXi & UF,
const Eigen::MatrixXd & NV,
const Eigen::MatrixXi & NF);
#endif