Home › Forums › GAMES在线课程(现代计算机图形学入门)讨论区 › 作业6 centroidBounds用重心坐标是否是优化
Tagged: 作业六
- This topic has 6 replies, 2 voices, and was last updated 4 years ago by Bear.
-
AuthorPosts
-
-
为什么不是
Bounds3 centroidBounds;
for (int i = 0; i < objects.size(); ++i)
centroidBounds =
Union(centroidBounds, objects[i]->getBounds());而是
Bounds3 centroidBounds;
for (int i = 0; i < objects.size(); ++i)
centroidBounds =
Union(centroidBounds, objects[i]->getBounds().Centroid());
这样会导致包围盒没有完全包围面片 -
第一张图片是 MeshTriangle bounding_box的包围盒信息
第二张图片是 第一次遍历所有Triangle Union(centroidBounds, objects[i]->getBounds().Centroid());centroidBounds的包围盒信息
第三张图片是 第一次遍历所有Triangle Union(centroidBounds, objects[i]->getBounds());centroidBounds的包围盒信息
-
作业6源码数据
Printing description of this->bounding_box:
(Bounds3) bounding_box = {
pMin = (x = -5.66282558, y = 1.99859393, z = -3.70075011)
pMax = (x = 3.64672804, y = 11.2197609, z = 3.52287841)
center = (x = 0, y = 0, z = 0)
}centroidBounds = Union(centroidBounds, objects[i]->getBounds().Centroid());
Printing description of centroidBounds:
(Bounds3) centroidBounds = {
pMin = (x = -5.65854406, y = 2.00797772, z = -3.6927402)
pMax = (x = 3.64121199, y = 11.1884823, z = 3.50062847)
center = (x = 0, y = 0, z = 0)
}centroidBounds = Union(centroidBounds, objects[i]->getBounds());
Printing description of centroidBounds:
(Bounds3) centroidBounds = {
pMin = (x = -5.66282558, y = 1.99859393, z = -3.70075011)
pMax = (x = 3.64672804, y = 11.2197609, z = 3.52287841)
center = (x = 0, y = 0, z = 0)
}
-
-
AuthorPosts
- You must be logged in to reply to this topic.