当前位置: 首页>>代码示例>>C#>>正文


C# Vector3.Project方法代码示例

本文整理汇总了C#中System.Vector3.Project方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3.Project方法的具体用法?C# Vector3.Project怎么用?C# Vector3.Project使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Vector3的用法示例。


在下文中一共展示了Vector3.Project方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Form1_MouseMove

 private void Form1_MouseMove(object sender, MouseEventArgs e)
 {
     Coordinates.Coordinate projCoord = new MOBMAP.Coordinates.Coordinate(new Geometry.Point(e.X,e.Y),false);
     Vector3 position = new Vector3(0,0,0);
     position.Project(map.device.Viewport, map.device.Transform.Projection, map.device.Transform.View, map.device.Transform.World);
     position.X = e.X;
     position.Y = e.Y;
     position.Unproject(map.device.Viewport, map.device.Transform.Projection, map.device.Transform.View, map.device.Transform.World);
 }
开发者ID:mnieznalska,项目名称:mobmap,代码行数:9,代码来源:Form1.cs

示例2: PrintString

		private void PrintString(string text,float x,float y,float z,Color color,Microsoft.DirectX.Direct3D.Font printFont) {
			Vector3 screenPoint=new Vector3(x,y,z);
			screenPoint.Project(device.Viewport,device.Transform.Projection,device.Transform.View,device.Transform.World);
			printFont.DrawText(null,text,new Point((int)Math.Ceiling(screenPoint.X),(int)Math.Floor(screenPoint.Y)),color);
		}
开发者ID:mnisl,项目名称:OD,代码行数:5,代码来源:ToothChartDirectX.cs

示例3: Project

 /// <summary>
 /// Projects a point from world to screen coordinates.
 /// </summary>
 /// <param name="point">Point in world space</param>
 /// <returns>Point in screen space</returns>
 public Vector3 Project(Vector3 point)
 {
     point.Project(viewPort, m_ProjectionMatrix, m_ViewMatrix, m_WorldMatrix);
     return point;
 }
开发者ID:beginor,项目名称:WorldWind,代码行数:10,代码来源:Camera.cs

示例4: ForwardVectorProjection

        /// <summary>
        /// This projection results to initial velocity of non-engine objects, which parents move in some velocity
        /// We want to add only forward speed of the parent to the forward direction of the object, and if parent
        /// is going backward, no speed is added.
        /// </summary>
        /// <param name="forwardVector"></param>
        /// <param name="projectedVector"></param>
        /// <returns></returns>
        public static Vector3 ForwardVectorProjection(Vector3 forwardVector, Vector3 projectedVector)
        {
            Vector3 forwardVelocity = forwardVector;

            if (Vector3.Dot(projectedVector, forwardVector) > 0)
            {  //going forward
                forwardVelocity = forwardVector.Project(projectedVector + forwardVector);
                return forwardVelocity;
            }

            return Vector3.Zero;
        }
开发者ID:Bunni,项目名称:Miner-Wars-2081,代码行数:20,代码来源:MyMath.cs

示例5: Mark3DCursorPosition

        /// <summary>
        /// The mark 3 d cursor position.
        /// </summary>
        /// <param name="x">The x.</param>
        /// <param name="y">The y.</param>
        /// <param name="m">The m.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public Vector3 Mark3DCursorPosition(float x, float y, Matrix m)
        {
            Vector3 tempV3 = new Vector3();
            tempV3.Project(device.Viewport, device.Transform.Projection, device.Transform.View, m);

            tempV3.X = x;
            tempV3.Y = y;
            tempV3.Unproject(device.Viewport, device.Transform.Projection, device.Transform.View, m);

            return tempV3;
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:19,代码来源:Renderer.cs


注:本文中的System.Vector3.Project方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。