Jump to content

O'Reilly's Learning XNA 4.0 - Camera not functioning properly.

Cupcake_101's Photo
Posted Oct 14 2012 11:13 AM
2915 Views

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)));

Tags:
1 Subscribe


1 Reply

0
  ChrisOlson's Photo
Posted Oct 24 2012 02:56 PM

Hi,

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 booktech@oreilly.com and I can pass it to the author.

Thanks,
Chris Olson
O'Reilly Book Support