本文整理汇总了C#中Sledge.UI.Viewport3D.ScreenToWorld方法的典型用法代码示例。如果您正苦于以下问题:C# Viewport3D.ScreenToWorld方法的具体用法?C# Viewport3D.ScreenToWorld怎么用?C# Viewport3D.ScreenToWorld使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sledge.UI.Viewport3D
的用法示例。
在下文中一共展示了Viewport3D.ScreenToWorld方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderAxisRotating
private void RenderAxisRotating(Viewport3D viewport, Document document)
{
var axis = Vector3.UnitX;
var c = Color.Red;
if (_mouseDown == CircleType.Y)
{
axis = Vector3.UnitY;
c = Color.Lime;
}
if (_mouseDown == CircleType.Z)
{
axis = Vector3.UnitZ;
c = Color.Blue;
}
if (_mouseDown == CircleType.Outer)
{
var vp3 = _activeViewport as Viewport3D;
if (vp3 != null) axis = (vp3.Camera.LookAt - vp3.Camera.Location).Normalized();
c = Color.White;
}
if (_activeViewport != viewport || _mouseDown != CircleType.Outer)
{
GL.Begin(PrimitiveType.Lines);
var zero = new Vector3((float) _pivotPoint.DX, (float) _pivotPoint.DY, (float) _pivotPoint.DZ);
GL.Color4(c);
GL.Vertex3(zero - axis * 100000);
GL.Vertex3(zero + axis * 100000);
GL.End();
}
if (_activeViewport == viewport)
{
GL.Disable(EnableCap.DepthTest);
GL.Enable(EnableCap.LineStipple);
GL.LineStipple(5, 0xAAAA);
GL.Begin(PrimitiveType.Lines);
GL.Color4(Color.FromArgb(64, Color.Gray));
GL.Vertex3(_pivotPoint.ToVector3());
GL.Vertex3(viewport.ScreenToWorld(_mouseDownPoint).ToVector3());
GL.Color4(Color.LightGray);
GL.Vertex3(_pivotPoint.ToVector3());
GL.Vertex3(viewport.ScreenToWorld(_mouseMovePoint).ToVector3());
GL.End();
GL.Disable(EnableCap.LineStipple);
GL.Enable(EnableCap.DepthTest);
}
}