2
XNA에서 프로그래밍을 시작했습니다. 나는 간단한 프로젝트를 개발하여 블렌더에서 내 보낸 "fbx"메쉬 모델을로드합니다. 모든 것이 완벽하게 작동합니다. 하지만 지금은 바닥을 만들기 위해 여러 번 내 모델을 복제/복사하고 싶습니다! 10 X 10 모델의 행렬입니다. 여러 코드를 시도했지만 작동하지 않습니다. 여기 내 샘플 코드입니다.그리기 전에 메쉬 모델의 위치를 조절하는 방법
내 모델을 복제 할 수없는 이유를 모르겠다.
대단히 감사합니다.
//Function draw models mesh
private void draw_groundLand1()
{
//Draw 10 times model texture to make small ground
for (int a = 0; a < 10; a++)
{
// Copy any parent transforms.
Matrix[] transforms = new Matrix[model_ground_land1.Bones.Count];
model_ground_land1.CopyAbsoluteBoneTransformsTo(transforms);
// Draw the model. A model can have multiple meshes, so loop.
foreach (ModelMesh mesh in model_ground_land1.Meshes)
{
// This is where the mesh orientation is set, as well
// as our camera and projection.
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.World = transforms[mesh.ParentBone.Index] *
Matrix.CreateRotationY(cubeGroundLand1_modelRotation) * Matrix.CreateTranslation(cubeGroundLand1_position);
effect.View = View;
//effect.Texture = text_ground_lan1;
effect.Projection = Projection;
}
// Draw the mesh, using the effects set above.
mesh.Draw();
}
//Move position for the next mesh modal to draw
cubeGroundLand1_position.X += (float)1.0;
}
}