Matrix.CreateConstrainedBillboard Method (Vector3%, Vector3%, Vector3%, Nullable<Vector3>, Nullable<Vector3>, Matrix%)
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Creates a cylindrical billboard that rotates around a specified axis.
Namespace: Microsoft.Xna.Framework
Assembly: Microsoft.Xna.Framework.Math (in Microsoft.Xna.Framework.Math.dll)
Syntax
'Declaration
Public Shared Sub CreateConstrainedBillboard ( _
ByRef objectPosition As Vector3, _
ByRef cameraPosition As Vector3, _
ByRef rotateAxis As Vector3, _
cameraForwardVector As Nullable(Of Vector3), _
objectForwardVector As Nullable(Of Vector3), _
<OutAttribute> ByRef result As Matrix _
)
public static void CreateConstrainedBillboard(
ref Vector3 objectPosition,
ref Vector3 cameraPosition,
ref Vector3 rotateAxis,
Nullable<Vector3> cameraForwardVector,
Nullable<Vector3> objectForwardVector,
out Matrix result
)
Parameters
- objectPosition
Type: Microsoft.Xna.Framework.Vector3%
Position of the object the billboard will rotate around.
- cameraPosition
Type: Microsoft.Xna.Framework.Vector3%
Position of the camera.
- rotateAxis
Type: Microsoft.Xna.Framework.Vector3%
Axis to rotate the billboard around.
- cameraForwardVector
Type: System.Nullable<Vector3>
Optional forward vector of the camera.
- objectForwardVector
Type: System.Nullable<Vector3>
Optional forward vector of the object.
- result
Type: Microsoft.Xna.Framework.Matrix%
[OutAttribute] The created billboard matrix.
Remarks
This method computes the facing direction of the billboard from the object position and camera position. When the object and camera positions are too close, the matrix will not be accurate. To avoid this problem, the method uses the optional camera forward vector if the positions are too close.
Version Information
Silverlight
Supported in: 5
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
See Also