Sign in to follow this  
Cappah

XNA-WinForm Mouse not rotating 3D Camera

Recommended Posts

I'm building a level editor and I've been stuck at getting the mouse to work properly. I've managed to display

a model at the Vector.Zero coordinates with my camera set at Vector3(0, 50, 150).

 

Keyboard input works as it should as an independent Free Camera. My end goal is to get the camera to

freely move and rotate around a scene. The problem comes when I'm trying to pitch and yaw the camera

by mouse. I've set the camera to supposedly rotate in whatever direction by moving the mouse while holding

the right mouse button down. But what happens is that the second I click the mouse button, my model disappears.

I tried using a bigger model (terrain this time) and the same results happened. From my code, does anyone see the

the problem?

 

 

 Attached is the free camera and custom panel for displaying and updating.

 

**NOTE** 

The Draw method in the panel class acts in place of Draw and Update in a regular XNA project (for those that don't know

about XNA within WinForms). 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this