本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}