TriMesh

Inheritance: java.lang.Object, com.aspose.threed.A3DObject, com.aspose.threed.SceneObject, com.aspose.threed.Entity

All Implemented Interfaces: java.lang.Iterable

public class TriMesh extends Entity implements Iterable<Vertex>

TriMesh は GPU が直接使用できる生データを含みます。このクラスは、頂点ごとのデータのみを含むメッシュを構築するためのユーティリティです。 Example: 次のコードは、カスタムメモリレイアウトの TriMesh を作成し、ファイルにエクスポートする方法を示しています。

//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
              VertexDeclaration vd = new VertexDeclaration();
              vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
              vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
              vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
              //convert a mesh to tri-mesh using specified memory layout
              var mesh = (new Sphere()).toMesh();
              var triMesh = TriMesh.fromMesh(vd, mesh);
              //save it to a stream, 115 vertices * 32bytes per vertex
              try(var s = new FileOutputStream("output.bin")) {
                  triMesh.writeVerticesTo(s);
                  //save indices as ushort to stream, 504 indices * 2 bytes per index
                  triMesh.write16bIndicesTo(s);
              }

コンストラクタ

コンストラクタ説明
TriMesh(String name, VertexDeclaration declaration)TriMesh のインスタンスを初期化する

メソッド

メソッド説明
addTriangle(int a, int b, int c)新しい三角形を追加する
beginVertex()頂点の追加を開始する
copyFrom(TriMesh input, VertexDeclaration vd)入力から新しい頂点レイアウトで TriMesh をコピーする
endVertex()頂点の追加を終了する
equals(Object arg0)
findProperty(String propertyName)プロパティを検索します。
fromMesh(Mesh mesh)指定されたメッシュオブジェクトから TriMesh を作成します。頂点宣言は入力メッシュの構造に基づきます。
fromMesh(Mesh mesh, boolean useFloat)指定されたメッシュオブジェクトから TriMesh を作成します。頂点宣言は入力メッシュの構造に基づきます。
fromMesh(VertexDeclaration declaration, Mesh mesh)指定された頂点レイアウトを使用して、指定されたメッシュオブジェクトから TriMesh を作成する。
fromRawData(VertexDeclaration vd, byte[] vertices, int[] indices, boolean generateVertexMapping)生データから TriMesh を作成する
getBoundingBox()現在のエンティティのオブジェクト空間座標系におけるバウンディングボックスを取得します。
getCapacity()事前割り当てされた頂点の容量。
getClass()
getEntityRendererKey()レンダラーに登録されたエンティティレンダラーのキーを取得します
getExcluded()エクスポート時にこのエンティティを除外するかどうかを取得します。
getIndicesCount()この TriMesh のインデックス数。
getIntIndices()インデックスを 32 ビット整数配列に変換する
getName()名前を取得します。
getParentNode()最初の親ノードを取得します。最初の親ノードを設定すると、このエンティティは他の親ノードから切り離されます。
getParentNodes()すべての親ノードを取得します。エンティティはジオメトリインスタンシングのために複数の親ノードにアタッチできます。
getProperties()すべてのプロパティのコレクションを取得します。
getProperty(String property)指定されたプロパティの値を取得します
getScene()このオブジェクトが属するシーンを取得します
getShortIndices()インデックスを 16 ビット整数配列に変換する
getUnmergedVerticesCount()beginVertexendVertex によって渡された未マージ頂点の数。
getVertexDeclaration()TriMesh の頂点レイアウト。
getVerticesCount()この TriMesh の頂点数。
getVerticesSizeInBytes()すべての頂点の合計サイズ(バイト)
hashCode()
indicesToArray(int[][] result)インデックスを 32 ビット整数配列に変換する
indicesToArray(short[][] result)インデックスを 16 ビット整数配列に変換する
iterator()Vertex を列挙するための列挙子を取得する
loadVerticesFromBytes(byte[] verticesInBytes)バイトから頂点をロードします。バイト長は頂点サイズの整数倍である必要があります。
notify()
notifyAll()
readDouble(int idx, VertexField field)double フィールドを読み取る
readFVector2(int idx, VertexField field)vector2 フィールドを読み取る
readFVector3(int idx, VertexField field)vector3 フィールドを読み取る
readFVector4(int idx, VertexField field)vector4 フィールドを読み取ります
readFloat(int idx, VertexField field)float フィールドを読み取ります
readVector2(int idx, VertexField field)vector2 フィールドを読み取る
readVector3(int idx, VertexField field)vector3 フィールドを読み取る
readVector4(int idx, VertexField field)vector4 フィールドを読み取ります
removeProperty(Property property)動的プロパティを削除します。
removeProperty(String property)名前で識別される指定されたプロパティを削除します
setExcluded(boolean value)エクスポート時にこのエンティティを除外するかどうかを設定します。
setName(String value)名前を設定します。
setParentNode(Node value)最初の親ノードを設定します。最初の親ノードを設定すると、このエンティティは他の親ノードから切り離されます。
setProperty(String property, Object value)指定されたプロパティの値を設定します
toString()TriMesh の文字列表現を取得します
verticesToArray()頂点データをバイト配列に変換します
wait()
wait(long arg0)
wait(long arg0, int arg1)
write16bIndicesTo(Stream stream)インデックスデータを 16 ビット整数としてストリームに書き込みます Example:
write16bIndicesTo(OutputStream stream)インデックスデータを 16 ビット整数としてストリームに書き込みます
write32bIndicesTo(Stream stream)インデックスデータを 32 ビット整数としてストリームに書き込みます Example:
write32bIndicesTo(OutputStream stream)インデックスデータを 32 ビット整数としてストリームに書き込みます
writeVerticesTo(Stream stream)指定されたストリームに頂点データを書き込みます
writeVerticesTo(OutputStream stream)指定されたストリームに頂点データを書き込みます

TriMesh(String name, VertexDeclaration declaration)

public TriMesh(String name, VertexDeclaration declaration)

TriMesh のインスタンスを初期化する

Parameters:

パラメーター説明
名前java.lang.Stringこの TriMesh の名前
declarationVertexDeclaration頂点の宣言

addTriangle(int a, int b, int c)

public void addTriangle(int a, int b, int c)

新しい三角形を追加する

Parameters:

パラメーター説明
aint最初の頂点のインデックス
bint2 番目の頂点のインデックス
cint3 番目の頂点のインデックス

beginVertex()

public Vertex beginVertex()

頂点の追加を開始する

Returns: Vertex - The reference of internal vertex object in type Vertex

copyFrom(TriMesh input, VertexDeclaration vd)

public static TriMesh copyFrom(TriMesh input, VertexDeclaration vd)

入力から新しい頂点レイアウトで TriMesh をコピーする

Parameters:

パラメーター説明
inputTriMeshコピー用の入力 TriMesh
vdVertexDeclaration出力 TriMesh の新しい頂点宣言

Returns: TriMesh - A new TriMesh instance with new vertex declaration. Example:

//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
  VertexDeclaration vd = new VertexDeclaration();
  vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
  vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
  vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
  //convert a mesh to TriMesh, the layout is automatically inferred from input mesh
  var oldTriMesh = TriMesh.fromMesh((new Sphere()).toMesh());
  //now create a new TriMesh from old TriMesh, using explicit memory layout defined by vd
  var newTriMesh = TriMesh.copyFrom(oldTriMesh, vd);

endVertex()

public int endVertex()

頂点の追加を終了する

Returns: int

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

パラメーター説明
arg0java.lang.Object

Returns: boolean

findProperty(String propertyName)

public Property findProperty(String propertyName)

プロパティを検索します。動的プロパティ(CreateDynamicProperty/SetProperty により作成)またはネイティブプロパティ(名前で識別)になる可能性があります。

Parameters:

パラメーター説明
propertyNamejava.lang.Stringプロパティ名。

Returns: Property - The property.

fromMesh(Mesh mesh)

public static TriMesh fromMesh(Mesh mesh)

指定されたメッシュオブジェクトから TriMesh を作成します。頂点宣言は入力メッシュの構造に基づきます。

Parameters:

パラメーター説明
meshMesh

Returns: TriMesh - The TriMesh generated from given Mesh Example: The following code shows how to create a TriMesh with custom memory layout, and export it to file.

//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
              VertexDeclaration vd = new VertexDeclaration();
              vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
              vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
              vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
              //convert a mesh to tri-mesh using specified memory layout
              var mesh = (new Sphere()).toMesh();
              var triMesh = TriMesh.fromMesh(vd, mesh);
              //save it to a stream, 115 vertices * 32bytes per vertex
              try(var s = new FileOutputStream("output.bin")) {
                  triMesh.writeVerticesTo(s);
                  //save indices as ushort to stream, 504 indices * 2 bytes per index
                  triMesh.write16bIndicesTo(s);
              }

fromMesh(Mesh mesh, boolean useFloat)

public static TriMesh fromMesh(Mesh mesh, boolean useFloat)

指定されたメッシュオブジェクトから TriMesh を作成します。頂点宣言は入力メッシュの構造に基づきます。

Parameters:

パラメーター説明
meshMesh
useFloatboolean各頂点要素コンポーネントに対して、double 型の代わりに float 型を使用します。

Returns: TriMesh - The TriMesh generated from given Mesh Example: The following code shows how to create a TriMesh with custom memory layout, and export it to file.

//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
              VertexDeclaration vd = new VertexDeclaration();
              vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
              vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
              vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
              //convert a mesh to tri-mesh using specified memory layout
              var mesh = (new Sphere()).toMesh();
              var triMesh = TriMesh.fromMesh(vd, mesh);
              //save it to a stream, 115 vertices * 32bytes per vertex
              try(var s = new FileOutputStream("output.bin")) {
                  triMesh.writeVerticesTo(s);
                  //save indices as ushort to stream, 504 indices * 2 bytes per index
                  triMesh.write16bIndicesTo(s);
              }

fromMesh(VertexDeclaration declaration, Mesh mesh)

public static TriMesh fromMesh(VertexDeclaration declaration, Mesh mesh)

指定された頂点レイアウトを使用して、指定されたメッシュオブジェクトから TriMesh を作成する。

Parameters:

パラメーター説明
declarationVertexDeclaration頂点の型定義、またはメモリレイアウト
meshMeshソースメッシュ

Returns: TriMesh - Instance of TriMesh converted from input mesh with specified vertex’s memory layout Example: The following code shows how to create a TriMesh with custom memory layout, and export it to file.

//Define a vertex declaration as {FVector3 Position; FVector3 Normal; FVector2 UV}
              VertexDeclaration vd = new VertexDeclaration();
              vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
              vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.NORMAL);
              vd.addField(VertexFieldDataType.F_VECTOR2, VertexFieldSemantic.UV);
              //convert a mesh to tri-mesh using specified memory layout
              var mesh = (new Sphere()).toMesh();
              var triMesh = TriMesh.fromMesh(vd, mesh);
              //save it to a stream, 115 vertices * 32bytes per vertex
              try(var s = new FileOutputStream("output.bin")) {
                  triMesh.writeVerticesTo(s);
                  //save indices as ushort to stream, 504 indices * 2 bytes per index
                  triMesh.write16bIndicesTo(s);
              }

fromRawData(VertexDeclaration vd, byte[] vertices, int[] indices, boolean generateVertexMapping)

public static TriMesh fromRawData(VertexDeclaration vd, byte[] vertices, int[] indices, boolean generateVertexMapping)

生データから TriMesh を作成する

Parameters:

パラメーター説明
vdVertexDeclaration頂点宣言は、少なくとも 1 つのフィールドを含む必要があります。
verticesbyte[]入力頂点データ、頂点の最小長さは頂点宣言のサイズ以上である必要があります
インデックスint[]三角形インデックス
generateVertexMappingboolean各頂点に対して Vertex を生成しますが、シリアライズ/デシリアライズだけの場合は必要ありません。

Returns: TriMesh - The TriMesh instance that encapsulated the input byte array. Remarks: The returned TriMesh will not copy the input byte array for performance, external changes on the array will be reflected to this instance. Example: The following code shows how to construct a TriMesh from raw bytes, this is useful when build your own 3D format

var indices = new int[] { 0,  1,  2 };
  var vertices = new byte[]{
      0, 0, 0, 191,
      0, 0, 0, 0,
      0, 0, 0, 191,
      0, 0, 0, 191,
      0, 0, 0, 0,
      0, 0, 0, 63,
      0, 0, 0, 63,
      0, 0, 0, 0The string representation,
      0, 0, 0, 63
  };
  VertexDeclaration vd = new VertexDeclaration();
  vd.AddField(VertexFieldDataType.FVector3, VertexFieldSemantic.Position);
  var triMesh = TriMesh.FromRawData(vd, vertices, indices, true);

getBoundingBox()

public BoundingBox getBoundingBox()

現在のエンティティのオブジェクト空間座標系におけるバウンディングボックスを取得します。

Returns: BoundingBox - the bounding box of current entity in its object space coordinate system. Example: The following code shows how to calculate the bounding box of a shape

Entity entity = new Sphere();
     entity.setRadius(10);
     var bbox = entity.getBoundingBox();
     System.out.printf("The bounding box of the entity is %s ~ %s", bbox.getMinimum(), bbox.getMaximum());

getCapacity()

public int getCapacity()

事前割り当てされた頂点の容量。

Returns: int - 事前割り当てされた頂点の容量

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getEntityRendererKey()

public EntityRendererKey getEntityRendererKey()

レンダラーに登録されたエンティティレンダラーのキーを取得します

Returns: EntityRendererKey - the key of the entity renderer registered in the renderer

getExcluded()

public boolean getExcluded()

エクスポート時にこのエンティティを除外するかどうかを取得します。

Returns: boolean - エクスポート時にこのエンティティを除外するかどうか。

getIndicesCount()

public int getIndicesCount()

この TriMesh のインデックス数。

Returns: int - この TriMesh のインデックス数

getIntIndices()

public int[] getIntIndices()

インデックスを 32 ビット整数配列に変換する

Returns: int[]

getName()

public String getName()

名前を取得します。

Returns: java.lang.String - 名前です。

getParentNode()

public Node getParentNode()

最初の親ノードを取得します。最初の親ノードを設定すると、このエンティティは他の親ノードから切り離されます。

Returns: Node - the first parent node, if set the first parent node, this entity will be detached from other parent nodes.

getParentNodes()

public ArrayList<Node> getParentNodes()

すべての親ノードを取得します。エンティティはジオメトリインスタンシングのために複数の親ノードにアタッチできます。

Returns: java.util.ArrayList<com.aspose.threed.Node> - すべての親ノード、エンティティはジオメトリ インスタンシングのために複数の親ノードにアタッチできます

getProperties()

public PropertyCollection getProperties()

すべてのプロパティのコレクションを取得します。

Returns: PropertyCollection - the collection of all properties.

getProperty(String property)

public Object getProperty(String property)

指定されたプロパティの値を取得します

Parameters:

パラメーター説明
プロパティjava.lang.Stringプロパティ名

Returns: java.lang.Object - 見つかったプロパティの値

getScene()

public Scene getScene()

このオブジェクトが属するシーンを取得します

Returns: Scene - the scene that this object belongs to

getShortIndices()

public short[] getShortIndices()

インデックスを 16 ビット整数配列に変換する

Returns: short[]

getUnmergedVerticesCount()

public int getUnmergedVerticesCount()

beginVertexendVertex によって渡された未マージ頂点の数。

Returns: int - beginVertexendVertex によって渡された未マージ頂点の数。

getVertexDeclaration()

public VertexDeclaration getVertexDeclaration()

TriMesh の頂点レイアウト。

Returns: VertexDeclaration - The vertex layout of the TriMesh.

getVerticesCount()

public int getVerticesCount()

この TriMesh の頂点数。

Returns: int - この TriMesh の頂点数

getVerticesSizeInBytes()

public int getVerticesSizeInBytes()

すべての頂点の合計サイズ(バイト)

Returns: int - すべての頂点の合計サイズ(バイト単位)

hashCode()

public native int hashCode()

Returns: int

indicesToArray(int[][] result)

public void indicesToArray(int[][] result)

インデックスを 32 ビット整数配列に変換する

Parameters:

パラメーター説明
結果int[][]

indicesToArray(short[][] result)

public void indicesToArray(short[][] result)

インデックスを 16 ビット整数配列に変換する

Parameters:

パラメーター説明
結果short[][]

iterator()

public Iterator<Vertex> iterator()

Vertex を列挙するための列挙子を取得する

Returns: java.util.Iterator<com.aspose.threed.Vertex>

loadVerticesFromBytes(byte[] verticesInBytes)

public void loadVerticesFromBytes(byte[] verticesInBytes)

バイトから頂点をロードします。バイトの長さは頂点サイズの整数倍である必要があります。Example: 以下のコードは、空の TriMesh を作成し、生のバイトから手動で頂点をロードする方法を示しています。

var indices = new int[] { 0,  1,  2 };
  var vertices = new byte[]{
      0, 0, 0, 191,
      0, 0, 0, 0,
      0, 0, 0, 191,
      0, 0, 0, 191,
      0, 0, 0, 0,
      0, 0, 0, 63,
      0, 0, 0, 63,
      0, 0, 0, 0,
      0, 0, 0, 63
  };
  VertexDeclaration vd = new VertexDeclaration();
  vd.AddField(VertexFieldDataType.FVector3, VertexFieldSemantic.Position);
  //create an empty TriMesh with specified vertex declaration
  var triMesh = new TriMesh("", vd);
  //load vertices directly from bytes
  triMesh.LoadVerticesFromBytes(vertices);
  triMesh.AddTriangle(0, 1, 2);
int[] indices = new int[] { 0,  1,  2 };
  byte[] vertices = new byte[]{
      0, 0, 0, 191,
      0, 0, 0, 0,
      0, 0, 0, 191,
      0, 0, 0, 191,
      0, 0, 0, 0,
      0, 0, 0, 63,
      0, 0, 0, 63,
      0, 0, 0, 0,
      0, 0, 0, 63
  };
  VertexDeclaration vd = new VertexDeclaration();
  vd.addField(VertexFieldDataType.F_VECTOR3, VertexFieldSemantic.POSITION);
  //create an empty TriMesh with specified vertex declaration
  var triMesh = new TriMesh("", vd);
  //load vertices directly from bytes
  triMesh.loadVerticesFromBytes(vertices);
  triMesh.addTriangle(0, 1, 2);

Parameters:

パラメーター説明
verticesInBytesbyte[]

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

readDouble(int idx, VertexField field)

public double readDouble(int idx, VertexField field)

double フィールドを読み取る

Parameters:

パラメーター説明
idxint読み取る頂点のインデックス
fieldVertexFieldfloat/double 互換のデータ型を持つフィールド

Returns: double - 指定された頂点のフィールドの Double 値

readFVector2(int idx, VertexField field)

public FVector2 readFVector2(int idx, VertexField field)

vector2 フィールドを読み取る

Parameters:

パラメーター説明
idxint読み取る頂点のインデックス
fieldVertexFieldVector2/FVector2 データ型を持つフィールド

Returns: FVector2 - FVector2 of specified vertex’s field

readFVector3(int idx, VertexField field)

public FVector3 readFVector3(int idx, VertexField field)

vector3 フィールドを読み取る

Parameters:

パラメーター説明
idxint読み取る頂点のインデックス
fieldVertexFieldVector3/FVector3 データ型を持つフィールド

Returns: FVector3

readFVector4(int idx, VertexField field)

public FVector4 readFVector4(int idx, VertexField field)

vector4 フィールドを読み取ります

Parameters:

パラメーター説明
idxint読み取る頂点のインデックス
fieldVertexFieldVector4/FVector4 データ型を持つフィールド

Returns: FVector4

readFloat(int idx, VertexField field)

public float readFloat(int idx, VertexField field)

float フィールドを読み取ります

Parameters:

パラメーター説明
idxint読み取る頂点のインデックス
fieldVertexFieldfloat/double 互換のデータ型を持つフィールド

Returns: float - 指定された頂点のフィールドの Float 値

readVector2(int idx, VertexField field)

public Vector2 readVector2(int idx, VertexField field)

vector2 フィールドを読み取る

Parameters:

パラメーター説明
idxint読み取る頂点のインデックス
fieldVertexFieldVector2/FVector2 データ型を持つフィールド

Returns: Vector2 - Vector2 of specified vertex’s field

readVector3(int idx, VertexField field)

public Vector3 readVector3(int idx, VertexField field)

vector3 フィールドを読み取る

Parameters:

パラメーター説明
idxint読み取る頂点のインデックス
fieldVertexFieldVector3/FVector3 データ型を持つフィールド

Returns: Vector3

readVector4(int idx, VertexField field)

public Vector4 readVector4(int idx, VertexField field)

vector4 フィールドを読み取ります

Parameters:

パラメーター説明
idxint読み取る頂点のインデックス
fieldVertexFieldVector4/FVector4 データ型を持つフィールド

Returns: Vector4

removeProperty(Property property)

public boolean removeProperty(Property property)

動的プロパティを削除します。

Parameters:

パラメーター説明
propertyProperty削除するプロパティ

Returns: boolean - プロパティが正常に削除された場合は true

removeProperty(String property)

public boolean removeProperty(String property)

名前で識別される指定されたプロパティを削除します

Parameters:

パラメーター説明
プロパティjava.lang.String削除するプロパティ

Returns: boolean - プロパティが正常に削除された場合は true

setExcluded(boolean value)

public void setExcluded(boolean value)

エクスポート時にこのエンティティを除外するかどうかを設定します。

Parameters:

パラメーター説明
boolean新しい値

setName(String value)

public void setName(String value)

名前を設定します。

Parameters:

パラメーター説明
java.lang.String新しい値

setParentNode(Node value)

public void setParentNode(Node value)

最初の親ノードを設定します。最初の親ノードを設定すると、このエンティティは他の親ノードから切り離されます。

Parameters:

パラメーター説明
valueNode新しい値

setProperty(String property, Object value)

public void setProperty(String property, Object value)

指定されたプロパティの値を設定します

Parameters:

パラメーター説明
プロパティjava.lang.Stringプロパティ名
java.lang.Objectプロパティの値

toString()

public String toString()

TriMesh の文字列表現を取得します

Returns: java.lang.String - 文字列表現

verticesToArray()

public byte[] verticesToArray()

頂点データをバイト配列に変換します

Returns: byte[]

wait()

public final void wait()

wait(long arg0)

public final void wait(long arg0)

Parameters:

パラメーター説明
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

パラメーター説明
arg0long
arg1int

write16bIndicesTo(Stream stream)

public void write16bIndicesTo(Stream stream)

インデックスデータを 16 ビット整数としてストリームに書き込みます Example:

//convert a mesh to TriMesh, the layout is automatically inferred from input mesh
      var mesh = (new Sphere()).toMesh();
      var triMesh = TriMesh.fromMesh(mesh);
      //save it to a stream, 115 vertices * 32bytes per vertex
      var stream = new ByteArrayOutputStream();
      try(var s = Stream.wrap(stream)) {
          triMesh.writeVerticesTo(s);
          //save indices as ushort to stream, 504 indices * 2 bytes per index
          triMesh.write16bIndicesTo(s);
      }

Parameters:

パラメーター説明
streamStream

write16bIndicesTo(OutputStream stream)

public void write16bIndicesTo(OutputStream stream)

インデックスデータを 16 ビット整数としてストリームに書き込みます

Parameters:

パラメーター説明
ストリームjava.io.OutputStream
//convert a mesh to TriMesh, the layout is automatically inferred from input mesh    
     var mesh = (new Sphere()).toMesh();    
     var triMesh = TriMesh.fromMesh(mesh);    
     //save it to a stream, 115 vertices * 32bytes per vertex    
     var stream = new ByteArrayOutputStream();    
     triMesh.writeVerticesTo(stream);    
     //save indices as ushort to stream, 504 indices * 2 bytes per index    
     triMesh.write16bIndicesTo(stream);
``` |

### write32bIndicesTo(Stream stream) {#write32bIndicesTo-com.aspose.threed.Stream-}

public void write32bIndicesTo(Stream stream)



インデックスデータを 32 ビット整数としてストリームに書き込みます **Example:**

//convert a mesh to TriMesh, the layout is automatically inferred from input mesh var mesh = (new Sphere()).toMesh(); var triMesh = TriMesh.fromMesh(mesh); //save it to a stream, 115 vertices * 32bytes per vertex var stream = new ByteArrayOutputStream(); try(var s = Stream.wrap(stream)) { triMesh.writeVerticesTo(s); //save indices as ushort to stream, 504 indices * 2 bytes per index triMesh.write32bIndicesTo(s); }


**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
| stream | [Stream](../../com.aspose.threed/stream) |  |

### write32bIndicesTo(OutputStream stream) {#write32bIndicesTo-java.io.OutputStream-}

public void write32bIndicesTo(OutputStream stream)



インデックスデータを 32 ビット整数としてストリームに書き込みます

**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
|  | ストリーム | java.io.OutputStream | **例:** |

//convert a mesh to TriMesh, the layout is automatically inferred from input mesh
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
var stream = new ByteArrayOutputStream();
triMesh.writeVerticesTo(stream);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write32bIndicesTo(stream);


### writeVerticesTo(Stream stream) {#writeVerticesTo-com.aspose.threed.Stream-}

public void writeVerticesTo(Stream stream)



指定されたストリームに頂点データを書き込みます

**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
|  | stream | [Stream](../../com.aspose.threed/stream) | 頂点データが書き込まれるストリーム **例:** |

//convert a mesh to TriMesh, the layout is automatically inferred from input mesh var mesh = (new Sphere()).toMesh(); var triMesh = TriMesh.fromMesh(mesh); //save it to a stream, 115 vertices * 32bytes per vertex var stream = new ByteArrayOutputStream(); try(var s = Stream.wrap(stream)) { triMesh.writeVerticesTo(s); //save indices as ushort to stream, 504 indices * 2 bytes per index triMesh.write16bIndicesTo(s); }


### writeVerticesTo(OutputStream stream) {#writeVerticesTo-java.io.OutputStream-}

public void writeVerticesTo(OutputStream stream)



指定されたストリームに頂点データを書き込みます

**Parameters:**
| パラメーター | 型 | 説明 |
| --- | --- | --- |
|  | ストリーム | java.io.OutputStream | 頂点データが書き込まれるストリーム **例:** |

//convert a mesh to TriMesh, the layout is automatically inferred from input mesh
var mesh = (new Sphere()).toMesh();
var triMesh = TriMesh.fromMesh(mesh);
//save it to a stream, 115 vertices * 32bytes per vertex
var stream = new ByteArrayOutputStream();
triMesh.writeVerticesTo(stream);
//save indices as ushort to stream, 504 indices * 2 bytes per index
triMesh.write16bIndicesTo(stream);