# [MDX] Camera Troubles

This topic is 4158 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I think my theory and what is actually happening is off, because I'm lost in 3D space. Using the coordinates of the triangle, if I positioned the camera at 0,0,-20, should it not be facing the triangle?
        private void CameraPositioning()
{
device.Transform.Projection = Matrix.PerspectiveFovLH(
(float)Math.PI / 4,
this.Width / this.Height,
1f,
50f);

device.Transform.View = Matrix.LookAtLH(
new Vector3(0, 0, 0),
new Vector3(0, 0, 0),
new Vector3(0, 1, 0));
}

private void VertexDeclaration()
{
vertices = new CustomVertex.PositionTextured[3];

vertices[0].Position = new Vector3(10f, 10f, 0f);
vertices[0].Tu = 0;
vertices[0].Tv = 0;

vertices[1].Position = new Vector3(-10f, -10f, 0f);
vertices[1].Tu = 1;
vertices[1].Tv = 1;

vertices[2].Position = new Vector3(10f, -10f, 0f);
vertices[2].Tu = 0;
vertices[2].Tv = 1;
}



##### Share on other sites
Maybe it's just an error in your post, but your Matrix.LootAtLH has the position at (0,0,0) not (0,0,-20)

##### Share on other sites
Whoops, I did have that at 0,0,-20. I must have changed it later trying to fix it.

##### Share on other sites
Nevermind, I realized I was calling two different methods to do the same thing, which was set up the camera. :S

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633271
• Total Posts
3011161
• ### Who's Online (See full list)

There are no registered users currently online

×