public void DrawOperandB() { GL.PushMatrix(); GL.Translate(Math.Cos(MySphereXOffset), -1f, Math.Cos(MySphereZOffset)); OperandB.Draw(); GL.PopMatrix(); }
/// <summary>Add your game rendering code here.</summary> /// <param name="e">Contains timing information.</param> /// <remarks>There is no need to call the base implementation.</remarks> protected override void OnRenderFrame(FrameEventArgs e) { this.Title = "FPS: " + (1 / e.Time).ToString("0."); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); GL.UseProgram(ProgramObject); #region Textures GL.ActiveTexture(TMU0_Unit); GL.BindTexture(TMU0_Target, TMU0_Handle); #endregion Textures #region Uniforms GL.Uniform1(GL.GetUniformLocation(ProgramObject, "Earth"), TMU0_UnitInteger); #endregion Uniforms GL.PushMatrix(); Matrix4 temp = Matrix4.LookAt(EyePos, Vector3.Zero, Vector3.UnitY); GL.MultMatrix(ref temp); GL.Rotate(Trackball.X, Vector3.UnitY); GL.Rotate(Trackball.Y, Vector3.UnitX); #region Draw GL.Color3(1f, 1f, 1f); sphere.Draw(); #endregion Draw GL.PopMatrix(); this.SwapBuffers(); }
public void DrawOperandA() { GL.Enable(EnableCap.Texture2D); OperandA.Draw(); GL.Disable(EnableCap.Texture2D); }