• Create Account

### #ActualMedo3337

Posted 08 January 2013 - 02:41 AM

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);

### #2Medo3337

Posted 08 January 2013 - 02:41 AM

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 degree (random degree)
// Rotate 0-360 angle
D3DXVec3TransformCoord(&rayDirection, &rayOrigin, &rotation);

### #1Medo3337

Posted 08 January 2013 - 02:39 AM

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 degree (random degree) // Rotate 0-360 angle D3DXVec3TransformCoord(&rayDirection, &rayOrigin, &rotation);

PARTNERS