本文整理匯總了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);
}
}