示例#1
0
        private TMat4x4 GetFatherMat()
        {
            if (Father != null)
            {
                return(Father.CombinedMatrix);
            }

            return(TMat4x4.UnitMat());
        }
示例#2
0
        // Constructor
        public CRenderContext(int W, int H)
        {
            VScreen = new Bitmap(W, H);
            ZBuffer = new float[W * H];

            // Prepare graphics canvases for the form and for the virtual screen
            VScreenCanvas = Graphics.FromImage(VScreen);

            BackgroundColor = DEFAULT_BACKGROUND_COLOR;
            PenForWireFrame = new Pen(DEFAULT_PEN_COLOR, 1);
            ViewMatrix      = TMat4x4.UnitMat();

            Width  = W;
            Height = H;

            HalfWidth  = Width / 2;
            HalfHeight = Height / 2;
        }