Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 作业6 centroidBounds用重心坐标是否是优化

Tagged: 

  • This topic has 6 replies, 2 voices, and was last updated 4 years ago by Bear.
Viewing 6 reply threads
  • Author
    Posts
    • #5123 Score: 0
      打雷要下雨雷欧
      Participant
      3 pts

      为什么不是
      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());
      这样会导致包围盒没有完全包围面片

    • #5124 Score: 0
      打雷要下雨雷欧
      Participant
      3 pts

      第一张图片是 MeshTriangle bounding_box的包围盒信息

      第二张图片是 第一次遍历所有Triangle Union(centroidBounds, objects[i]->getBounds().Centroid());centroidBounds的包围盒信息

      第三张图片是 第一次遍历所有Triangle Union(centroidBounds, objects[i]->getBounds());centroidBounds的包围盒信息

    • #5125 Score: 0
      打雷要下雨雷欧
      Participant
      3 pts

      图1

      Attachments:
      You must be logged in to view attached files.
    • #5127 Score: 0
      打雷要下雨雷欧
      Participant
      3 pts

      图2

      Attachments:
      You must be logged in to view attached files.
    • #5129 Score: 0
      打雷要下雨雷欧
      Participant
      3 pts

      图3

      Attachments:
      You must be logged in to view attached files.
    • #5131 Score: 0
      打雷要下雨雷欧
      Participant
      3 pts

      作业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)
      }

    • #5143 Score: 0
      Bear
      Participant
      -11 pt

      因为要的就是包质心。。。

      Attachments:
      You must be logged in to view attached files.
Viewing 6 reply threads
  • You must be logged in to reply to this topic.