Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 20 Jun 2012
Offline Last Active Jul 25 2012 08:11 PM

Posts I've Made

In Topic: Help with xna textures

09 July 2012 - 03:09 AM

Just a guess, but maybe a look here might be in order: http://blogs.msdn.co...studio-4-0.aspx

Thanx that helpedPosted Image

In Topic: Help with xna textures

08 July 2012 - 03:08 PM

Okay, I somehow discovered the source of the problem. Its because I used the spritebatch. I used the spritebatch to draw a spritefont(frame rate). When I stopped using it the texture rendered correctly. I do not understand how the spritebatch caused the texture of the terrain to not to render correctly.

In Topic: Help with xna textures

08 July 2012 - 02:51 PM

You copied the CODE but not the content like image files. Just drag and drop the image to your content project. Or click right mouse button on it and choose "add existing element". Pay attention to the LoadContent()-method.The relative path after Content.Load<Texture2D> has to be exactly the same as in your content-project.

I have added the "rocks.bmp" to the Content. I did not see the texture because it is not displayed on the whole terrain but only on the edges.

In Topic: Help with xna textures

08 July 2012 - 01:52 PM

You need to add the texture to your content-pipeline too.

I copied exactly the code from the sample. So I think its already added.

In Topic: World, View, and Projection Matrices

21 June 2012 - 07:28 AM

I used the following code to get the camera:

Matrix3D Camera
                Vector3D cameraZAxis = -this.LookDirection;

                Vector3D cameraXAxis = Vector3D.CrossProduct(this.UpDirection, cameraZAxis);

                Vector3D cameraYAxis = Vector3D.CrossProduct(cameraZAxis, cameraXAxis);

                Vector3D cameraPosition = (Vector3D)this.Position;
                double offsetX = -Vector3D.DotProduct(cameraXAxis, cameraPosition);
                double offsetY = -Vector3D.DotProduct(cameraYAxis, cameraPosition);
                double offsetZ = -Vector3D.DotProduct(cameraZAxis, cameraPosition);

                return new Matrix3D(new double[,]{{cameraXAxis.X, cameraYAxis.X, cameraZAxis.X, 0},
                                    {cameraXAxis.Y, cameraYAxis.Y, cameraZAxis.Y, 0},
                                    {cameraXAxis.Z, cameraYAxis.Z, cameraZAxis.Z, 0},
                                    {offsetX, offsetY, offsetZ, 1}});

The default camera matrix is
after I multiply the three matrices(the third is the model matrix) by the point and the resulting W in the point is very huge like -13000 Posted Image so I am very confused right now!!
the model matrix is
Can you tell me where I have gone wrong?
note: this is not xn