예제 #1
0
파일: Camera.cs 프로젝트: kwaegel/muTracer
        public Camera(System.Drawing.Rectangle clientBounds, MuxEngine.LinearAlgebra.Matrix4 xform)
            : base(xform)
        {
            ClientBounds = clientBounds;

            initCommon ();
        }
예제 #2
0
파일: Movable.cs 프로젝트: kwaegel/muTracer
 public Movable(MuxEngine.LinearAlgebra.Matrix4 xform)
 {
     m_rotation = xform.Rotation;
     m_position = xform.Translation;
     m_scale = new Vector3 (1,1,1);
 }
예제 #3
0
 public ClTextureCamera(Rectangle clientBounds, ComputeCommandQueue commandQueue, MuxEngine.LinearAlgebra.Matrix4 transform)
     : base(clientBounds, transform)
 {
     rayTracingInit(commandQueue);
 }
예제 #4
0
파일: Camera.cs 프로젝트: kwaegel/muTracer
        protected void computeViewMatrix(ref MuxEngine.LinearAlgebra.Matrix4 world)
        {
            // Compute view matrix directly for speed
            //   To invert the world matrix we transpose it
            //   We ensure it's orthonormal first
            Vector3 zDir = world.Backward;
            Vector3.Normalize (ref zDir, out zDir);
            Vector3 xDir = Vector3.Cross (world.Up, zDir);
            Vector3.Normalize (ref xDir, out xDir);
            Vector3 yDir = Vector3.Cross (zDir, xDir);

            // Column four shouldn't deviate from [ 0 0 0 1 ]
            m_view.M11 = xDir.X;
            m_view.M12 = yDir.X;
            m_view.M13 = zDir.X;
            m_view.M21 = xDir.Y;
            m_view.M22 = yDir.Y;
            m_view.M23 = zDir.Y;
            m_view.M31 = xDir.Z;
            m_view.M32 = yDir.Z;
            m_view.M33 = zDir.Z;
            Vector3 eye = world.Translation;
            m_view.M41 = -Vector3.Dot (eye, xDir);
            m_view.M42 = -Vector3.Dot (eye, yDir);
            m_view.M43 = -Vector3.Dot (eye, zDir);
        }
예제 #5
0
		public RayTracingCamera(System.Drawing.Rectangle clientBounds, MuxEngine.LinearAlgebra.Matrix4 transform)
			: base(clientBounds, transform)
		{
			rayTracingInit();
		}