Tag Info

New answers tagged

0

Your top code chunk is: t2 * (t1 * direction * inverse(t1)) * inverse(t2) Your bottom chunk is: t3 * direction * inverse(t3) Given that t3 = t2 * t1 It's (t2 * t1) * direction * inverse(t2 * t1) As far as my knowledge of Quaternion multiplication goes, I don't think t2 * (t1 * direction * inverse(t1)) * inverse(t2) and (t2 * t1) * direction * ...


1

He's trying to oscillate between V and V+U*0.01+R*0.1, I think. If you want to visualize, it is trying to do something like the picture below: The arrow at the top represents the path DIR will take as time proceeds and it will go back to V when the sin value becomes zero. The summation, just adds the 'perturb' effect to the DIR vector, so that it doesn't ...


4

The three component vectors right, up, and forward probably point along the axes x, y, and z relative to the camera. So by adding these vectors together you can compose any other vector. It works the same as if you built a vector by specifying its three elements individually, except that you are adding three vectors which each have one non-zero element. ...


0

the way to create your Quaternion rotations matrices (I assume from euler angles) look funny, I would expect you use unit vectors of each axis rather than axis XMMATRIX rotateQX = XMMatrixRotationQuaternion(MathHelper::XMConvertToQuaternion(XMFLOAT3(1, 0, 0), radianRotation.x)); XMMATRIX rotateQY = ...


0

On this line: XMStoreFloat4x4(&mWorld, scaling*rotateQX*rotateQY*rotateQZ*translate); does changing the order to: XMStoreFloat4x4(&mWorld, translate*rotateQX*rotateQY*rotateQZ*scaling); make a difference? If you meant to rotate about the origin then translate outwards then you need to be careful with your ordering, though I'm making assumptions ...


2

I'd expect the conversion to be more like: static XMVECTOR XMConvertToQuaternion(XMFLOAT3 axis, float radian) { return XMVectorSet(sin(radian/2)*axis.x, sin(radian/2)*axis.y, sin(radian/2)*axis.z, cos(radian/2)); } in particular there is no need to push the coordinates through a cos and the w should be the last coordinate, there is a micro optimization ...


1

Do I use XMMatrixRotationQuaternion(XMVECTOR quaternion) and multiply the resultant Matrix with my scaling matrix and translation matrix to get my transformation matrix? I believe so. At least that's what I do with D3D9. (D3DXMatrixRotationQuaternion) You might already know but multiplication order should be : scalingMatrix * rotationMatrix * ...



Top 50 recent answers are included