Original Post
Im new and I won't get ahold of a book on XNA till tommorow if my bookstore has one in stock so I thought Ide post my question up here since it might be awhile. Im trying to draw and position 2 models on screen using these two bits of code. I was hoping someone could write up a working example of taking two models and drawing/rendering them beside each other. Saying the models are p1_wedge and p2_wedge. Code Courtesy of MSDN Tutorial ------------------------------------------------------------------------------- // Set the 3D model to draw. Model myModel; // The aspect ratio determines how to scale 3d to 2d projection. float aspectRatio; protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); myModel = Content.Load("Models\\p1_wedge"); aspectRatio = (float)graphics.GraphicsDevice.Viewport.Width / (float)graphics.GraphicsDevice.Viewport.Height; } -------------------------------------------------------------------- // Set the position of the model in world space, and set the rotation. Vector3 modelPosition = Vector3.Zero; float modelRotation = 0.0f; // Set the position of the camera in world space, for our view matrix. Vector3 cameraPosition = new Vector3(0.0f, 50.0f, 5000.0f); protected override void Draw(GameTime gameTime) { graphics.GraphicsDevice.Clear(Color.CornflowerBlue); // Copy any parent transforms. Matrix[] transforms = new Matrix[myModel.Bones.Count]; myModel.CopyAbsoluteBoneTransformsTo(transforms); // Draw the model. A model can have multiple meshes, so loop. foreach (ModelMesh mesh in myModel.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(modelRotation) * Matrix.CreateTranslation(modelPosition); effect.View = Matrix.CreateLookAt(cameraPosition, Vector3.Zero, Vector3.Up); effect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.ToRadians(45.0f), aspectRatio, 1.0f, 10000.0f); } // Draw the mesh, using the effects set above. mesh.Draw(); } base.Draw(gameTime); } ------------------------------------------------------------------------------