added proper texturing support

This commit is contained in:
Hartmut Seichter 2021-02-04 22:56:27 +01:00
parent 749bb67c6c
commit b25ab14587
9 changed files with 108 additions and 61 deletions

View file

@ -10,11 +10,23 @@ int main(int argc,char **argv) {
pw::geometry geo;
pw::vector3_array vs = { {-1,-1,0},{1,-1,0},{0,1,0} };
pw::vector3_array vs = {
{ -1, 1, 0 },
{ -1,-1, 0 },
{ 1,-1, 0 },
{ 1, 1, 0 }
};
pw::geometry::indices_t idx = {
0, 1, 2,
0, 2, 3
};
geo.set_vertices(vs);
geo.set_indices(idx);
geo.compute_normals();

View file

@ -36,6 +36,16 @@ int main(int ,char **) {
std::cout << "v3.normalized() = " << pw::serialize::matrix(v3.normalized()) << std::endl;
auto e1 = pw::vector3 { 2.0, 0.0, 0.0 };
auto e2 = pw::vector3 { 0.0, 0.0, 2.0 };
auto e2_e1 = e1 - e2;
auto n_e1_e2 = pw::vector3::cross(e1,e2);
std::cout << "e1xe2 " << pw::serialize::matrix(n_e1_e2) << std::endl;
std::cout << "e1xe2 " << pw::serialize::matrix(e2_e1) << std::endl;
return 0;
}