Games101 作业7 路径追踪

       学霸笔记

       还是学霸笔记

       写这个作业写 b u g bug bug 写到吐了,首先强调一点, w i n d o w window window 下跑这份代码的同学,需要修改 g l o b a l . c p p global.cpp global.cpp 中的 g e t _ r a n d o m _ f l o a t get\_random\_float get_random_float 函数,不然你的这个"随机函数"每次都是跑出来相同的结果(而且改了这个函数显著的提升效率, l i n u x linux linux 的同学应该也可以改改)。

       修改如下👇

static std::random_device dev;
static std::mt19937 rng(dev());
static std::uniform_real_distribution<float> dist(0.f, 1.f); // distribution in range [1, 6]

inline float get_random_float()
{
   
    return dist(rng);
}

       前三个函数参考作业6,差异在于 I n t e r s e c t P IntersectP IntersectP 函数的判别条件,因为这个灯 tmd 没有厚度,你以文本格式查看 l i g h t . o b j light.obj

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值