Geometry.ComputeBoundingBox メソッド
[このドキュメントはプレビュー版であり、後のリリースで変更されることがあります。 空白のトピックは、プレースホルダーとして挿入されています。]
座標軸を原点とする境界ボックスを算出します。
名前空間: Microsoft.WindowsMobile.DirectX.Direct3D
アセンブリ: Microsoft.WindowsMobile.DirectX (Microsoft.WindowsMobile.DirectX.dll 内)
構文
'宣言
Public Shared Sub ComputeBoundingBox ( _
pointsFvf As GraphicsStream, _
numPoints As Integer, _
vertexFormat As VertexFormats, _
<OutAttribute> ByRef min As Vector3, _
<OutAttribute> ByRef max As Vector3 _
)
'使用
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
)
static member ComputeBoundingBox :
pointsFvf:GraphicsStream *
numPoints:int *
vertexFormat:VertexFormats *
min:Vector3 byref *
max:Vector3 byref -> unit
パラメーター
- pointsFvf
型 : Microsoft.WindowsMobile.DirectX.GraphicsStream
境界ボックスが作成された中心の点を格納している GraphicsStream オブジェクト。
- numPoints
型 : System.Int32
頂点の数。
- vertexFormat
型 : Microsoft.WindowsMobile.DirectX.Direct3D.VertexFormats
渡される頂点の形式を指定する VertexFormats オブジェクト。
- min
型 : Microsoft.WindowsMobile.DirectX.Vector3%
返される境界ボックスの左下隅を記述する Vector3 構造体。
- max
型 : Microsoft.WindowsMobile.DirectX.Vector3%
返される境界ボックスの右上隅を記述する Vector3 構造体。
例外
例外 | 条件 |
---|---|
InvalidCallException | メソッドの呼び出しが無効です。たとえば、メソッドのパラメーターに無効な値が含まれている場合などです。 |
例
ComputeBoundingBox メソッドの使用方法を次の例に示します。
' Create several meshes and associated data.Dim i AsIntegerFor 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();
}
.NET Framework セキュリティ
- 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分的に信頼される側のコードからライブラリの使用」を参照してください。
プラットフォーム
Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。 サポートされているバージョンについては、「.NET フレームワークのシステム要件」を参照してください。
バージョン情報
.NET Compact Framework
サポート対象 : 3.5、2.0