コード例 #1
0
        public override void WindowResized(int width, int height, float FOV)
        {
            CgGl.cgGLSetParameter3f(m_CGparam_viewParamsPass1, width, height, FOV);
            checkForCgError("setting viewParams pass 1");

            CgGl.cgGLSetParameter3f(m_CGparam_viewParamsPass2, width, height, FOV);
            checkForCgError("setting viewParams pass 2");
        }
コード例 #2
0
        private void SetShaderParametersPass2(Vector3f eyeVect)
        {
            CgGl.cgGLSetParameter3f(m_CGparam_eyePositionPass2, ViewerPosition.x, ViewerPosition.y, ViewerPosition.z);
            checkForCgError("setting eyePos2");

            // Track the combined model-view-projection matrix
            CgGl.cgGLSetStateMatrixParameter(m_CGparam_modelViewProjPass2,
                                             CgGl.CG_GL_MODELVIEW_PROJECTION_MATRIX,
                                             CgGl.CG_GL_MATRIX_IDENTITY);
            checkForCgError("setting model view projection matrix parameter2");

            //set modelViewIT matrix
            CgGl.cgGLSetStateMatrixParameter(m_CGparam_modelViewITPass2,
                                             CgGl.CG_GL_MODELVIEW_MATRIX,
                                             CgGl.CG_GL_MATRIX_INVERSE_TRANSPOSE);
            checkForCgError("setting model view IT matrix parameter2");

            CgGl.cgGLSetStateMatrixParameter(m_CGparam_modelViewPass2,
                                             CgGl.CG_GL_MODELVIEW_MATRIX,
                                             CgGl.CG_GL_MATRIX_IDENTITY);
            checkForCgError("setting model view matrix parameter2");
        }