public override void Draw(GL_ControlLegacy control) { control.UpdateModelMatrix(Matrix4.CreateScale(0.5f) * Matrix4.CreateTranslation(Position)); GL.BindTexture(TextureTarget.Texture2D, Framework.TextureSheet); #region drawfaces GL.Begin(PrimitiveType.Quads); GL.Color4(CubeColor); GL.TexCoord2(0.71875f, 0.515625f); GL.Vertex3(points[7]); GL.TexCoord2(0.53125f, 0.515625f); GL.Vertex3(points[6]); GL.TexCoord2(0.53125f, 0.984375f); GL.Vertex3(points[2]); GL.TexCoord2(0.71875f, 0.984375f); GL.Vertex3(points[3]); GL.Color4(CubeColor * 0.71875f); GL.TexCoord2(0.53125f, 0.515625f); GL.Vertex3(points[4]); GL.TexCoord2(0.71875f, 0.515625f); GL.Vertex3(points[5]); GL.TexCoord2(0.71875f, 0.984375f); GL.Vertex3(points[1]); GL.TexCoord2(0.53125f, 0.984375f); GL.Vertex3(points[0]); GL.End(); GL.Begin(PrimitiveType.QuadStrip); GL.TexCoord2(0.71875f, 0.515625f); GL.Color4(CubeColor); GL.Vertex3(points[7]); GL.Color4(CubeColor * 0.71875f); GL.Vertex3(points[5]); GL.Color4(CubeColor); GL.Vertex3(points[6]); GL.Color4(CubeColor * 0.71875f); GL.Vertex3(points[4]); GL.Color4(CubeColor); GL.Vertex3(points[2]); GL.Color4(CubeColor * 0.71875f); GL.Vertex3(points[0]); GL.Color4(CubeColor); GL.Vertex3(points[3]); GL.Color4(CubeColor * 0.71875f); GL.Vertex3(points[1]); GL.Color4(CubeColor); GL.Vertex3(points[7]); GL.Color4(CubeColor * 0.71875f); GL.Vertex3(points[5]); GL.End(); #endregion #region drawlines GL.Disable(EnableCap.Texture2D); GL.BindTexture(TextureTarget.Texture2D, 0); GL.Color4(CubeColor); GL.Begin(PrimitiveType.LineStrip); GL.Vertex3(points[6]); GL.Vertex3(points[2]); GL.Vertex3(points[3]); GL.Vertex3(points[7]); GL.Vertex3(points[6]); GL.Vertex3(points[4]); GL.Vertex3(points[5]); GL.Vertex3(points[1]); GL.Vertex3(points[0]); GL.Vertex3(points[4]); GL.End(); GL.Begin(PrimitiveType.Lines); GL.Vertex3(points[2]); GL.Vertex3(points[0]); GL.Vertex3(points[3]); GL.Vertex3(points[1]); GL.Vertex3(points[7]); GL.Vertex3(points[5]); GL.End(); #endregion GL.Enable(EnableCap.Texture2D); }
public override void Prepare(GL_ControlLegacy control) { }
public virtual void Draw(GL_ControlLegacy control, Pass pass, EditorSceneBase editorScene) { }
public override void Draw(GL_ControlLegacy control, Pass pass) { throw new NotImplementedException(); }
public virtual void Draw(GL_ControlLegacy controlLegacy) { }
public override void Draw(GL_ControlLegacy control) { transformAction.Draw(control); }
public static void Draw(GL_ControlLegacy control, Pass pass, Vector4 boxColor, Vector4 lineColor, Vector4 pickingColor) { if (pass == Pass.OPAQUE) { GL.Enable(EnableCap.Texture2D); GL.ActiveTexture(TextureUnit.Texture0); GL.BindTexture(TextureTarget.Texture2D, Framework.TextureSheet); #region draw textured faces Vector4 darkerColor = boxColor * 0.71875f; GL.Begin(PrimitiveType.Quads); GL.Color4(boxColor); GL.TexCoord2(0.71875f, 0.515625f); GL.Vertex3(points[7]); GL.TexCoord2(0.53125f, 0.515625f); GL.Vertex3(points[6]); GL.TexCoord2(0.53125f, 0.984375f); GL.Vertex3(points[2]); GL.TexCoord2(0.71875f, 0.984375f); GL.Vertex3(points[3]); GL.Color4(darkerColor); GL.TexCoord2(0.53125f, 0.515625f); GL.Vertex3(points[4]); GL.TexCoord2(0.71875f, 0.515625f); GL.Vertex3(points[5]); GL.TexCoord2(0.71875f, 0.984375f); GL.Vertex3(points[1]); GL.TexCoord2(0.53125f, 0.984375f); GL.Vertex3(points[0]); GL.End(); GL.Begin(PrimitiveType.QuadStrip); GL.TexCoord2(0.71875f, 0.515625f); GL.Color4(boxColor); GL.Vertex3(points[7]); GL.Color4(darkerColor); GL.Vertex3(points[5]); GL.Color4(boxColor); GL.Vertex3(points[6]); GL.Color4(darkerColor); GL.Vertex3(points[4]); GL.Color4(boxColor); GL.Vertex3(points[2]); GL.Color4(darkerColor); GL.Vertex3(points[0]); GL.Color4(boxColor); GL.Vertex3(points[3]); GL.Color4(darkerColor); GL.Vertex3(points[1]); GL.Color4(boxColor); GL.Vertex3(points[7]); GL.Color4(darkerColor); GL.Vertex3(points[5]); GL.End(); #endregion GL.Disable(EnableCap.Texture2D); GL.LineWidth(1); GL.Color4(lineColor); GL.CallList(lineDrawList); GL.LineWidth(2); } else if (pass == Pass.PICKING) { #region draw colored faces GL.Color4(pickingColor); GL.Begin(PrimitiveType.Quads); GL.Vertex3(points[7]); GL.Vertex3(points[6]); GL.Vertex3(points[2]); GL.Vertex3(points[3]); GL.Vertex3(points[4]); GL.Vertex3(points[5]); GL.Vertex3(points[1]); GL.Vertex3(points[0]); GL.End(); GL.Begin(PrimitiveType.QuadStrip); GL.Vertex3(points[7]); GL.Vertex3(points[5]); GL.Vertex3(points[6]); GL.Vertex3(points[4]); GL.Vertex3(points[2]); GL.Vertex3(points[0]); GL.Vertex3(points[3]); GL.Vertex3(points[1]); GL.Vertex3(points[7]); GL.Vertex3(points[5]); GL.End(); #endregion } }
public static void DrawWithoutTextures(GL_ControlLegacy control, Pass pass, Vector4 boxColor, Vector4 lineColor, Vector4 pickingColor) { if (pass == Pass.OPAQUE) { GL.Enable(EnableCap.Texture2D); #region draw colored faces GL.Color4(boxColor); GL.Begin(PrimitiveType.Quads); GL.Vertex3(points[7]); GL.Vertex3(points[6]); GL.Vertex3(points[2]); GL.Vertex3(points[3]); GL.Vertex3(points[4]); GL.Vertex3(points[5]); GL.Vertex3(points[1]); GL.Vertex3(points[0]); GL.End(); GL.Begin(PrimitiveType.QuadStrip); GL.Vertex3(points[7]); GL.Vertex3(points[5]); GL.Vertex3(points[6]); GL.Vertex3(points[4]); GL.Vertex3(points[2]); GL.Vertex3(points[0]); GL.Vertex3(points[3]); GL.Vertex3(points[1]); GL.Vertex3(points[7]); GL.Vertex3(points[5]); GL.End(); #endregion GL.LineWidth(1); GL.Color4(lineColor); GL.CallList(lineDrawList); GL.LineWidth(2); } else if (pass == Pass.PICKING) { #region draw colored faces GL.Color4(pickingColor); GL.Begin(PrimitiveType.Quads); GL.Vertex3(points[7]); GL.Vertex3(points[6]); GL.Vertex3(points[2]); GL.Vertex3(points[3]); GL.Vertex3(points[4]); GL.Vertex3(points[5]); GL.Vertex3(points[1]); GL.Vertex3(points[0]); GL.End(); GL.Begin(PrimitiveType.QuadStrip); GL.Vertex3(points[7]); GL.Vertex3(points[5]); GL.Vertex3(points[6]); GL.Vertex3(points[4]); GL.Vertex3(points[2]); GL.Vertex3(points[0]); GL.Vertex3(points[3]); GL.Vertex3(points[1]); GL.Vertex3(points[7]); GL.Vertex3(points[5]); GL.End(); #endregion GL.LineWidth(1); GL.CallList(lineDrawList); GL.LineWidth(2); } }
public abstract void Draw(GL_ControlLegacy control, Pass pass);
public override void Draw(GL_ControlLegacy control, Pass pass) { }
public abstract void Prepare(GL_ControlLegacy control);
public override void Prepare(GL_ControlLegacy control) { throw new NotImplementedException(); }
public override void Draw(GL_ControlLegacy control) { }
public virtual void DrawPicking(GL_ControlLegacy control) { }
public abstract void Draw(GL_ControlLegacy control);