프로젝트가 곧 완료 될 예정이며 3D Studio Max에서 만든 모델을로드하는 데 많은 문제가 있습니다. 내가 만든 모델은 내 XNA 게임에서 내 지형으로 원하는 것입니다. 내가 원하는 다음XNA에서 지형로드가 잘못됨 + 1 인칭 카메라
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
Model terrainModel;
Vector3 terrainPosition = Vector3.Zero;
Vector3 cameraPosition = new Vector3(0.0f, 60.0f, 160.0f);
Vector3 cameraLookAt = new Vector3(0.0f, 60.0f, 160.0f);
Matrix cameraProjectionMatrix;
Matrix cameraViewMatrix;
LoadContent()
spriteBatch = new SpriteBatch(GraphicsDevice);
cameraViewMatrix = Matrix.CreateLookAt(
cameraPosition,
Vector3.Zero,
Vector3.Up);
cameraProjectionMatrix = Matrix.CreatePerspectiveFieldOfView(
MathHelper.ToRadians(80.0f),
graphics.GraphicsDevice.Viewport.AspectRatio,
1.0f,
1000.0f);
terrainModel = Content.Load<Model>("alphastreet");
그리기 (GameTime gameTime)
GraphicsDevice.Clear(Color.CornflowerBlue);
DrawModel(terrainModel, terrainPosition);
// TODO: Add your drawing code here
base.Draw(gameTime);
그리고 :
방법을 : 여기에 지금까지 한 일이다 그리기 :
void DrawModel(Model model, Vector3 modelPosition)
{
foreach (ModelMesh mesh in model.Meshes)
{
foreach (BasicEffect effect in mesh.Effects)
{
effect.EnableDefaultLighting();
effect.PreferPerPixelLighting = true;
effect.World = Matrix.CreateTranslation(modelPosition);
effect.Projection = cameraProjectionMatrix;
effect.View = cameraViewMatrix;
}
mesh.Draw();
}
}
다른 모든 것은 XNA 파일이 보여야하는 것과 같습니다. 모델 자체는 상당히 직선적 인 거리처럼 보입니다. 그러나 XNA가 모델을로드하면 모델은로드되는 창에서 큰 블록 일뿐입니다.
나는 모델로드를 이렇게 만들고있는 것이 무엇인지 모르지만, 내 머리카락을 내쫓고 있습니다. 어떤 도움을 주시면 감사하겠습니다.
또한 누구나 나를 walk-through/guide 나 First Person Shooter 카메라를 만드는 수업으로 안내 할 수 있습니까? 그게 바로 제가 할 게임이기 때문입니다. 나는 아마 그것을 골라서는 안된다. 그러나 그것은 지금 바뀌는 것이 너무나 늦다. 그래서 만일 당신도 거기에서 도울 수 있으면 당신은 정말로 나의 피부를 절약 할 것이다!
감사합니다. Jake!