public override void Render(ViewControl vc) { BasicRendererFlags solid = BasicRendererFlags.Solid | BasicRendererFlags.DisableDepthTest; BasicRendererFlags wire = BasicRendererFlags.WireFrame | BasicRendererFlags.DisableDepthTest; Matrix4F normWorld = GetManipulatorMatrix(); if (normWorld == null) { return; } Camera camera = vc.Camera; Vec3F pos = normWorld.Translation; float s; Util.CalcAxisLengths(vc.Camera, pos, out s); Vec3F sv = new Vec3F(s, s, s); Vec3F axscale = new Vec3F(Math.Abs(s * m_scale.X), Math.Abs(s * m_scale.Y), Math.Abs(s * m_scale.Z)); Color xcolor = (m_hitRegion == HitRegion.XAxis || m_hitRegion == HitRegion.FreeRect) ? Color.Gold : Color.Red; Color ycolor = (m_hitRegion == HitRegion.YAxis || m_hitRegion == HitRegion.FreeRect) ? Color.Gold : Color.Green; Color Zcolor = (m_hitRegion == HitRegion.ZAxis || m_hitRegion == HitRegion.FreeRect) ? Color.Gold : Color.Blue; Color freeRect = (m_hitRegion == HitRegion.FreeRect) ? Color.Gold : Color.White; Matrix4F scale = new Matrix4F(); scale.Scale(axscale); Matrix4F xform = scale * normWorld; Util3D.RenderFlag = wire; Util3D.DrawX(xform, xcolor); Util3D.DrawY(xform, ycolor); Util3D.DrawZ(xform, Zcolor); Vec3F rectScale = sv * FreeRectRatio; scale.Scale(rectScale); Matrix4F b = Util.CreateBillboard(pos, camera.WorldEye, camera.Up, camera.LookAt); Matrix4F recXform = Matrix4F.Multiply(scale, b); Util3D.DrawRect(recXform, freeRect); Vec3F handle = sv * HandleRatio; float handleWidth = handle.X / 2; scale.Scale(handle); Matrix4F trans = new Matrix4F(); trans.Translation = new Vec3F(axscale.X - handleWidth, 0, 0); xform = scale * trans * normWorld; Util3D.RenderFlag = solid; Util3D.DrawCube(xform, xcolor); trans.Translation = new Vec3F(0, axscale.Y - handleWidth, 0); xform = scale * trans * normWorld; Util3D.DrawCube(xform, ycolor); trans.Translation = new Vec3F(0, 0, axscale.Z - handleWidth); xform = scale * trans * normWorld; Util3D.DrawCube(xform, Zcolor); }