I'm attempting to rotate a code-defined model, however it appears to be moving instead of rotating. I've looked all over, even copy/pasting, but to no avail.
Edit- This current code shows me using a custom effect, however, I'm basing all this off my previous edits (that being, using the BasicEffect)!
m_GraphicsDevice.BlendState = BlendState.Opaque;
m_GraphicsDevice.DepthStencilState = DepthStencilState.Default;
m_Effect.Parameters["View"].SetValue( m_Camera.View );
m_Effect.Parameters["Projection"].SetValue( m_Camera.Projection );
m_Effect.Parameters["CameraPosition"].SetValue( m_Camera.Position );
m_Effect.Parameters["Texture1"].SetValue( m_TextureAtlas );
foreach( EffectPass pass in m_Effect.CurrentTechnique.Passes )
{
foreach( Item item in m_World.ItemMap.Values )
{
if( item == null || !item.BoundingBox.Intersects( frustum ) )
continue;
Matrix matWorld = Matrix.CreateRotationY( fRROT );
m_Effect.Parameters["World"].SetValue( matWorld );
pass.Apply();
m_GraphicsDevice.SetVertexBuffer( item.m_VertexBuffer );
m_GraphicsDevice.Indices = item.m_IndexBuffer;
m_GraphicsDevice.DrawIndexedPrimitives( PrimitiveType.TriangleList, 0, 0,
item.m_VertexBuffer.VertexCount, 0, item.m_IndexBuffer.IndexCount / 3 );
I've tried using Matrix.CreateFromAxisAngle which did rotate, just not anywhere near the axis I want - even when defining just that axis.
My other attempt was Matrix.CreateRotationY(..) * Matrix.CreateTranslation(..) and still seemed to move.
Further information:
m_VertexBuffer = VertexPositionTexture
m_Effect = BasicEffect
ItemMap only contains 1 value for the time being.
I know Quanternations is better for this since it holds the rotation, but I'd like to avoid that route..