tags:

views:

31

answers:

0

I wanted to create a camera class, to allow for some simple camera controls. I only have OpenGL experience, so naturally I tried to imitate what I knew from there. Well, that failed miserably.

I run the following function just before I start drawing my world objects.

 public void Align()
 {
    Matrix theMatrix = r_device.GetTransform(TransformType.View);
    theMatrix.Translate(m_pos);
    theMatrix.RotateY(m_yaw);
    theMatrix.RotateX(m_pitch);
    r_device.SetTransform(TransformType.View, theMatrix);
 }

Now, as soon as I run any of those three middle lines, the screen goes black. If I just get, and then set, I can see my world objects. Even if I try to rotate 0.0f in any direction, and only that, it still goes black. Am I missing something here? I'm trying to avoid using an "up vector" and a "right vector" etc.

r_device is a reference to the Direct3D.Device object.