에 적용한 후 모델 위치를 가져 오는 중 here 위치에있는 모든 변환을 적용한 후에 모델이 그려지는 새 위치를 검색 할 수 있다면 정말 편리 할 것입니다. 망사. 나는 필요한 것을 위해이 방법을 조금 편집했다. 아무도 내가 이것을 할 수있는 방법을 알고 있습니까?goingBeyond XNA 튜토리얼에서 제공하는이 메소드의 모델 변환을 XNA
public void DrawModel(Camera camera)
{
Matrix scaleY = Matrix.CreateScale(new Vector3(1, 2, 1));
Matrix temp = Matrix.CreateScale(100f) * scaleY * rotationMatrix * translationMatrix * Matrix.CreateRotationY(MathHelper.Pi/6) * translationMatrix2;
Matrix[] modelTransforms = new Matrix[model.Bones.Count];
model.CopyAbsoluteBoneTransformsTo(modelTransforms);
if (camera.getDistanceFromPlayer(position+position1) > 3000) return;
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = modelTransforms[mesh.ParentBone.Index] * temp * worldMatrix;
effect.View = camera.viewMatrix;
effect.Projection = camera.projectionMatrix;
}
mesh.Draw();
}
}
http://gamedev.stackexchange.com/ – rcdmk