I wrote a code to update the position of one of the bones in XNA.
Mycode consists of three parts
First part is Loadcontent()
firstmodel = Content.Load<Model>("Models\\second-sample-");
worldtransforms = new Matrix[firstmodel.Bones.Count];
originalbonetransforms = new Matrix[firstmodel.Bones.Count];
bonetransforms = new Matrix[firstmodel.Bones.Count];
firstmodel.CopyAbsoluteBoneTransformsTo(originalbonetransforms);
firstmodel.CopyAbsoluteBoneTransformsTo(bonetransforms);
aspectratio = graphics.GraphicsDevice.Viewport.AspectRatio;
Second part consists of just updating the position of the bone and updating in worldtransform.
Update.
bonetransforms[Index] = originalbonetransforms[Index]* Matrix.CreateRotationX(50.5f) ;
worldtransforms[0] = bonetransforms[0];
for (int bone = 1; bone < worldtransforms.Length; bone++)
{
int parentbone = firstmodel.Bones[bone].Parent.Index;
worldtransforms[bone] = bonetransforms[bone] * worldtransforms[parentbone];
}
and finally Draw() method is as usual.
But control is directly going to
protected override void Initialize()
{
base.Initialize();
}
I defined all my methods as protected.
My question is that as soon as i run the code control moves from Lodecontent() to Initialize() and the model is displayed on screen, why it is not moving in to Update()