rotate the rayDirection around the rayOrigin point by this random degree lets say to the right
So, I need to create a matrix and use D3DXVec3TransformCoord(), right?
How should I do the rotation according to the random degree? I usually use D3DXMatrixRotationYawPitchRoll() for rotation but not sure how you are explaining the rotation here.
D3DXMATRIX rotation; // Rotate 2.1 degrees (random number) // Rotate 0-360 angle D3DXVec3TransformCoord(&rayDirection, &rayOrigin, &rotation);