Condividi tramite


Metodo Geometry.ComputeBoundingBox

Aggiornamento: novembre 2007

Calcola un riquadro di delimitazione orientato sull'asse delle coordinate.

Spazio dei nomi:  Microsoft.WindowsMobile.DirectX.Direct3D
Assembly:  Microsoft.WindowsMobile.DirectX (in Microsoft.WindowsMobile.DirectX.dll)

Sintassi

'Dichiarazione
Public Shared Sub ComputeBoundingBox ( _
    pointsFvf As GraphicsStream, _
    numPoints As Integer, _
    vertexFormat As VertexFormats, _
    <OutAttribute> ByRef min As Vector3, _
    <OutAttribute> ByRef max As Vector3 _
)
'Utilizzo
Dim pointsFvf As GraphicsStream
Dim numPoints As Integer
Dim vertexFormat As VertexFormats
Dim min As Vector3
Dim max As Vector3

Geometry.ComputeBoundingBox(pointsFvf, _
    numPoints, vertexFormat, min, max)
public static void ComputeBoundingBox(
    GraphicsStream pointsFvf,
    int numPoints,
    VertexFormats vertexFormat,
    out Vector3 min,
    out Vector3 max
)
public:
static void ComputeBoundingBox(
    GraphicsStream^ pointsFvf, 
    int numPoints, 
    VertexFormats vertexFormat, 
    [OutAttribute] Vector3% min, 
    [OutAttribute] Vector3% max
)
public static function ComputeBoundingBox(
    pointsFvf : GraphicsStream, 
    numPoints : int, 
    vertexFormat : VertexFormats, 
    min : Vector3, 
    max : Vector3
)

Parametri

Eccezioni

Eccezione Condizione
InvalidCallException

La chiamata al metodo non è valida. Il parametro di un metodo potrebbe, ad esempio, contenere un valore non valido.

Esempi

Nell'esempio seguente viene illustrato come utilizzare il metodo ComputeBoundingBox.

' Create several meshes and associated data.
Dim i As Integer
For i = 0 To numberOfMeshes
    Dim vertexData As GraphicsStream

    meshes(i) = Mesh.Box(device, 1F, 1F, 1F)

    ' Arrange the boxes in a grid, with each
    ' successive box farther in the distance.
    meshLocations(i) = New Vector3((i Mod 3) * 2 - 2, i / 3 * 2 - 2, i)

    ' Compute the bounding box for a mesh.
    Dim description As VertexBufferDescription = meshes(i).VertexBuffer.Description
    vertexData = meshes(i).VertexBuffer.Lock(0, 0, LockFlags.ReadOnly)
    Geometry.ComputeBoundingBox(vertexData, meshes(i).NumberVertices, description.VertexFormat, meshBoundingBoxMinValues(i), meshBoundingBoxMaxValues(i))
    meshes(i).VertexBuffer.Unlock()
Next i
// Create several meshes and associated data.
for (int i = 0; i < numberOfMeshes; i++)
{
    GraphicsStream vertexData;

    meshes[i] = Mesh.Box(device, 1.0f, 1.0f, 1.0f);

    // Arrange the boxes in a grid, with each
    // successive box farther in the distance.
    meshLocations[i] = new Vector3(((i % 3) * 2) - 2,
                                ((i / 3) * 2) - 2, i);

    // Compute the bounding box for a mesh.
    VertexBufferDescription description =
        meshes[i].VertexBuffer.Description;
    vertexData = meshes[i].VertexBuffer.Lock
                             (0, 0, LockFlags.ReadOnly);
    Geometry.ComputeBoundingBox(vertexData,
        meshes[i].NumberVertices,description.VertexFormat,
        out meshBoundingBoxMinValues[i],
        out meshBoundingBoxMaxValues[i]);
    meshes[i].VertexBuffer.Unlock();
}

Autorizzazioni

Piattaforme

Windows CE, Windows Mobile per Smartphone, Windows Mobile per Pocket PC

.NET Framework e .NET Compact Framework non supportano tutte le versioni di ciascuna piattaforma. Per un elenco delle versioni supportate, vedere Requisiti di sistema di .NET Framework.

Informazioni sulla versione

.NET Compact Framework

Supportato in: 3.5, 2.0

Vedere anche

Riferimenti

Geometry Classe

Membri Geometry

Spazio dei nomi Microsoft.WindowsMobile.DirectX.Direct3D