Hi, Have some few questions that are probably stupid questions.
Am trying to set the rotaxis to All zero so that my BasicCubeSecond Doesnt get a rotation at all. But everytime I try to do it I get some wierd error in the XNA source file, complaining about
> FusionEmpty.exe!XMAssert(const char * pExpression, const char * pFileName, unsigned int LineNumber) Line 1865 C++
And something about the program reaching a breakpoint (__debugbreak()) which I have no idea why.
Is my way to do it wrong?
[source lang="cpp"]void UpdateScene(){rot += .0005f;if(rot > 6.28){ rot = 0.0f;}//Reset Cube rotationBasicCube = XMMatrixIdentity();XMVECTOR rotaxis = XMVectorSet(0.0f,1.0f,0.0f,0.0f);WorldRotation = XMMatrixRotationAxis(rotaxis,rot);WorldTranslation = XMMatrixTranslation(0.0f,0.0f,4.0f);//Set cube1's world space using the transformationsBasicCube = WorldTranslation * WorldRotation;//Reset Cube 2BasicCubeSecond = XMMatrixIdentity();rotaxis = XMVectorSet(0.0f,0,0.0f,0.0f); //<------------------ Trying to set the rotation to 0WorldRotation = XMMatrixRotationAxis(rotaxis, rot);WorldScale = XMMatrixScaling(1.3f,1.3f,1.3f);//Set Cube 2BasicCubeSecond = WorldRotation * WorldScale;}[/source]
2 replies to this topic
Ad:
#2 Members - Reputation: 1149
Posted 05 December 2012 - 06:02 PM
Are you sure it is XMVectorSet line, not the XMMatrixRotationAxis one? Because if you look at the source of XMMatrixRotationAxis you'll see following code:
Basically it will assert if rotaxis equals to zero vector.
XMINLINE XMMATRIX XMMatrixRotationAxis
(
FXMVECTOR Axis,
FLOAT Angle
)
{
#if defined(_XM_NO_INTRINSICS_)
XMVECTOR Normal;
XMMATRIX M;
XMASSERT(!XMVector3Equal(Axis, XMVectorZero()));
XMASSERT(!XMVector3IsInfinite(Axis));
Normal = XMVector3Normalize(Axis);
M = XMMatrixRotationNormal(Normal, Angle);
return M;
#elif defined(_XM_SSE_INTRINSICS_)
XMASSERT(!XMVector3Equal(Axis, XMVectorZero()));
XMASSERT(!XMVector3IsInfinite(Axis));
XMVECTOR Normal = XMVector3Normalize(Axis);
XMMATRIX M = XMMatrixRotationNormal(Normal, Angle);
return M;
#else // _XM_VMX128_INTRINSICS_
#endif // _XM_VMX128_INTRINSICS_
}Basically it will assert if rotaxis equals to zero vector.






