<p>I am trying to reproduce the results of 2017 paper "Learning the light transport the reiforced way" by Duhm and Keller. I already know how to generate random samples inside the equally-sized patches on sphere. The normal of hemisphere around the hit point is along z-axis. And each ray direction generated by:</p>

<p><span class="math-container">$d = (sin(\phi)cos(\theta), sin(\phi)sin(\theta), cos(\phi))$</span></p>

<p>How could I apply rotations to this vectors by only knowing normals? Should I apply the rotations to patches or rays. For example, imagine the surface is a sphere and not a plane. I'm really confused how to do this!</p>

CC BY-SA 4.0
2019-10-27T18:31:52.447Z
http://jcgt.org/published/0006/01/01/
lightxbulb
CC BY-SA 4.0
2019-11-03T09:54:27.350Z
FWIW: I have some additional variants here: http://marc-b-reynolds.github.io/quaternions/2016/07/06/Orthonormal.html . Specifically you have a few knobs to turn:  1) lose some ops for slightly worse error bound, 2) ditch insured right-handed set 3) well define for whole sphere vs. not.
MB Reynolds
<raytracing>
The correct way to apply 3d rotations?
bitWise
# The correct way to apply 3d rotations?

(Asked by: username_0 on 2019-10-27)

I am trying to reproduce the results of 2017 paper "Learning the light transport the reiforced way" by Duhm and Keller. I already know how to generate random samples inside the equally-sized patches on sphere. The normal of hemisphere around the hit point is along z-axis. And each ray direction generated by:

$d = (sin(\phi)cos(\theta), sin(\phi)sin(\theta), cos(\phi))$

How could I apply rotations to this vectors by only knowing normals? Should I apply the rotations to patches or rays. For example, imagine the surface is a sphere and not a plane. I'm really confused how to do this!

**Tags:** raytracing

> **Comments:**
> **username_1**: http://jcgt.org/published/0006/01/01/  
> **username_2**: FWIW: I have some additional variants here: http://marc-b-username_2.github.io/quaternions/2016/07/06/Orthonormal.html . Specifically you have a few knobs to turn:  1) lose some ops for slightly worse error bound, 2) ditch insured right-handed set 3) well define for whole sphere vs. not.  

---

## 0 answers

