public static void InitProjection(GLCamera cur, GLCamera prev, double t, Size viewportSize) { Gl.glMatrixMode(Gl.GL_PROJECTION); Gl.glLoadIdentity(); cur.ApplyProjection(prev, t); Gl.glMatrixMode(Gl.GL_MODELVIEW); Gl.glLoadIdentity(); }
public void ApplyProjection(GLCamera prevProj, double t) { if (t <= 0.0) { prevProj.ApplyProjection(); } else if (t >= 1.0) { this.ApplyProjection(); AdjustEffects(); } else { double[] p = prevProj.GetProjMatrix(); double[] c = this.GetProjMatrix(); for (uint i = 0; i < 16; i++) { c[i] = c[i] * t + p[i] * (1.0 - t); } Gl.glMultMatrixd(c); AdjustEffects(); } }
public void ApplyProjection(GLCamera prevProj, double t) { if (t <= 0.0) prevProj.ApplyProjection(); else if (t >= 1.0) { this.ApplyProjection(); AdjustEffects(); } else { double[] p = prevProj.GetProjMatrix(); double[] c = this.GetProjMatrix(); for (uint i = 0; i < 16; i++) c[i] = c[i] * t + p[i] * (1.0 - t); Gl.glMultMatrixd(c); AdjustEffects(); } }