Jump to content
O'Reilly's Learning XNA 4.0 - Camera not functioning properly.
Asked by Cupcake_101
Posted Oct 14 2012 11:13 AM
Good evening fellows, I recently started reading the book O'Reilly Learning XNA 4.0 and i'm at the 3D camera movement. I noticed something wrong was happening with the camera, when i pitch up and down fast it begins to pitch slower to the point it stops and everything disappears. I don't know why this is happening because i'm new to the subject and i'm trying to find some answers. If anyone needs the code to know what i'm talking about here it is.
// Pitch rotation
cameraDirection = Vector3.Transform(cameraDirection, Matrix.CreateFromAxisAngle(Vector3.Cross(cameraUp, cameraDirection), (MathHelper.PiOver4 / 200) * (Mouse.GetState( ).Y - prevMouseState.Y)));
cameraUp = Vector3.Transform(cameraUp, Matrix.CreateFromAxisAngle(Vector3.Cross(cameraUp, cameraDirection), (MathHelper.PiOver4 / 200) * (Mouse.GetState( ).Y - prevMouseState.Y)));
Answered by ChrisOlson
Posted Oct 24 2012 02:56 PM
Can you post the full code that you are using? I had the author take a look at this, and he said he couldn't tell without seeing all of your code. If it's too much to post here, you can send it to email@example.com and I can pass it to the author.
O'Reilly Book Support