add triangle mesh affine transform
This commit is contained in:
@@ -43,5 +43,20 @@ int main() {
|
||||
|
||||
mesh.PrintSelf(std::cout);
|
||||
|
||||
TEST1(mesh.Points().size() == 3);
|
||||
TEST1(mesh.Triangles().size() == 1);
|
||||
|
||||
// Test transformation
|
||||
mesh.Translate(Vector3f(10, 20, 30));
|
||||
Vector3f p0 = mesh.GetPoint(0);
|
||||
TEST1( (p0 - Vector3f(10, 20, 30)).norm() < 1e-6 );
|
||||
|
||||
// Test AddPoint during transformation
|
||||
mesh.AddPoint(Vector3f(11, 21, 31)); // Should be stored as (1, 1, 1) locally
|
||||
Id_t lastId = mesh.Points().size() - 1;
|
||||
TEST1( (mesh.Points().at(lastId) - Vector3f(1, 1, 1)).norm() < 1e-5 );
|
||||
|
||||
mesh.PrintSelf(std::cout);
|
||||
|
||||
END_TESTING;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user