Inverse of a ray direction ?

462 views
Skip to first unread message

DJ Linux

unread,
Jul 14, 2016, 5:48:06 PM7/14/16
to pbrt
(sorry about my bad english)

In pbrt-2/3 and many other 3D apps and collision codes the inverse of the ray direction are used e.g.

Vector3f invDir(1 / ray.d.x, 1 / ray.d.y, 1 / ray.d.z)

But in all source codes I readed last years no one test x,y,z of zero

In all axis aligned ray direction (
forward, backward, right, left, up, down)

a coord from ray direction are 0.0 if you don't test it before a "division by zero" exeption are the result

How does preventing pbrt-2/3, this situation ?

thank you

DJ

Dimitryddd .

unread,
Jul 14, 2016, 11:02:01 PM7/14/16
to pb...@googlegroups.com
Hello
As far as I know this mehtod utilizes IEEE floating point standart property. It says that positive number divided by zero is +inf and negative number divide by zero is -inf You can finde more in this paper "An effecient and robust ray box intersection algorithm" by Amy Williams.

Dmitry

--
You received this message because you are subscribed to the Google Groups "pbrt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pbrt+uns...@googlegroups.com.
To post to this group, send email to pb...@googlegroups.com.
Visit this group at https://groups.google.com/group/pbrt.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages