Chapter 2: Bounding Volume Hierarchies 层次包围盒

关键是找一个完全包裹所有对象的盒子:

if (ray hits bounding object)
  return whether ray hits bounded objects
else
  return false

  

例如,我们把对象集分为两组,红和蓝,然后用矩形包围他们:

if (hits purple)
  hit0 = hits blue enclosed objects
  hit1 = hits red enclosed objects
  if (hit0 or hit1)
    return true and info of closer hit
return false

   

  

猜你喜欢

转载自www.cnblogs.com/TooYoungTsukasa/p/9153315.html
今日推荐