RayMeshGeometry3DHitTestResult.DistanceToRayOrigin Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the distance between the point of intersection and the ray's origin in the coordinate space of Visual3D which initiated the hit test.
public:
virtual property double DistanceToRayOrigin { double get(); };
public override double DistanceToRayOrigin { get; }
member this.DistanceToRayOrigin : double
Public Overrides ReadOnly Property DistanceToRayOrigin As Double
Double that indicates the distance between the point of intersection and the ray's origin in the coordinate space of Visual3D which initiated the hit test.
The following code excerpt reads this property.
public void UpdateResultInfo(RayMeshGeometry3DHitTestResult rayMeshResult)
{
HitVisualInfo.Text = rayMeshResult.VisualHit.ToString();
HitModelInfo.Text = rayMeshResult.ModelHit.ToString();
HitMeshInfo.Text = rayMeshResult.MeshHit.ToString();
//HitMaterialInfo.Text = (rayMeshResult.ModelHit as GeometryModel3D).Material.GetType().Name;
//HitMaterialBrushInfo.Text = ((rayMeshResult.ModelHit as GeometryModel3D).Material as DiffuseMaterial).Brush.ToString();
HitDistanceInfo.Text = rayMeshResult.DistanceToRayOrigin.ToString();
Vertex1Info.Text = (rayMeshResult.VertexWeight1 * 100) + "%";
Vertex2Info.Text = (rayMeshResult.VertexWeight2 * 100) + "%";
Vertex3Info.Text = (rayMeshResult.VertexWeight3 * 100) + "%";
}
Public Sub UpdateResultInfo(ByVal rayMeshResult As RayMeshGeometry3DHitTestResult)
HitVisualInfo.Text = rayMeshResult.VisualHit.ToString()
HitModelInfo.Text = rayMeshResult.ModelHit.ToString()
HitMeshInfo.Text = rayMeshResult.MeshHit.ToString()
HitDistanceInfo.Text = rayMeshResult.DistanceToRayOrigin.ToString()
Vertex1Info.Text = (rayMeshResult.VertexWeight1 * 100) & "%"
Vertex2Info.Text = (rayMeshResult.VertexWeight2 * 100) & "%"
Vertex3Info.Text = (rayMeshResult.VertexWeight3 * 100) & "%"
End Sub
Proizvod | Verzije |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
Povratne informacije o proizvodu .NET
.NET je projekt otvorenog koda. Odaberite vezu za slanje povratnih informacija: