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 인스턴스를 초기화합니다. |
메서드
TriMesh(String name, VertexDeclaration declaration)
public TriMesh(String name, VertexDeclaration declaration)
다음의 TriMesh 인스턴스를 초기화합니다.
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| 이름 | java.lang.String | 이 TriMesh의 이름 |
| declaration | VertexDeclaration | vertex의 선언 |
addTriangle(int a, int b, int c)
public void addTriangle(int a, int b, int c)
새 삼각형을 추가합니다.
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| a | int | 첫 번째 vertex의 인덱스 |
| b | int | 두 번째 vertex의 인덱스 |
| c | int | 세 번째 vertex의 인덱스 |
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:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| input | TriMesh | 복사를 위한 입력 TriMesh |
| vd | VertexDeclaration | 출력 TriMesh의 새로운 vertex 선언 |
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:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| arg0 | java.lang.Object |
Returns: boolean
findProperty(String propertyName)
public Property findProperty(String propertyName)
속성을 찾습니다. 동적 속성 (Created by CreateDynamicProperty/SetProperty) 또는 네이티브 속성 (Identified by its name)일 수 있습니다.
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| propertyName | java.lang.String | 속성 이름. |
Returns: Property - The property.
fromMesh(Mesh mesh)
public static TriMesh fromMesh(Mesh mesh)
주어진 메시 객체에서 TriMesh를 생성합니다. 정점 선언은 입력 메시의 구조를 기반으로 합니다.
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| mesh | Mesh |
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:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| mesh | Mesh | |
| useFloat | boolean | 각 vertex 요소 구성 요소에 대해 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:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| declaration | VertexDeclaration | Vertex의 타입 정의 또는 메모리 레이아웃 |
| mesh | Mesh | 소스 메시 |
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:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| vd | VertexDeclaration | Vertex 선언은 최소 하나의 필드를 포함해야 합니다. |
| vertices | byte[] | 입력 정점 데이터이며, 정점의 최소 길이는 정점 선언의 크기보다 크거나 같아야 합니다. |
| 인덱스 | int[] | 삼각형 인덱스 |
| generateVertexMapping | boolean | 각 정점에 대해 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()
이 beginVertex와 endVertex로 전달된 병합되지 않은 정점의 수입니다.
Returns: int - beginVertex와 endVertex로 전달된 병합되지 않은 정점의 개수.
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:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| verticesInBytes | byte[] |
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:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| idx | int | 읽을 정점의 인덱스 |
| field | VertexField | float/double 호환 데이터 타입을 가진 필드 |
Returns: double - 지정된 정점 필드의 Double 값
readFVector2(int idx, VertexField field)
public FVector2 readFVector2(int idx, VertexField field)
vector2 필드를 읽습니다.
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| idx | int | 읽을 정점의 인덱스 |
| field | VertexField | Vector2/FVector2 데이터 타입을 가진 필드 |
Returns: FVector2 - FVector2 of specified vertex’s field
readFVector3(int idx, VertexField field)
public FVector3 readFVector3(int idx, VertexField field)
vector3 필드를 읽습니다.
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| idx | int | 읽을 정점의 인덱스 |
| field | VertexField | Vector3/FVector3 데이터 타입을 가진 필드 |
Returns: FVector3
readFVector4(int idx, VertexField field)
public FVector4 readFVector4(int idx, VertexField field)
vector4 필드를 읽습니다
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| idx | int | 읽을 정점의 인덱스 |
| field | VertexField | Vector4/FVector4 데이터 타입을 가진 필드 |
Returns: FVector4
readFloat(int idx, VertexField field)
public float readFloat(int idx, VertexField field)
float 필드를 읽습니다
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| idx | int | 읽을 정점의 인덱스 |
| field | VertexField | float/double 호환 데이터 타입을 가진 필드 |
Returns: float - 지정된 정점 필드의 Float 값
readVector2(int idx, VertexField field)
public Vector2 readVector2(int idx, VertexField field)
vector2 필드를 읽습니다.
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| idx | int | 읽을 정점의 인덱스 |
| field | VertexField | Vector2/FVector2 데이터 타입을 가진 필드 |
Returns: Vector2 - Vector2 of specified vertex’s field
readVector3(int idx, VertexField field)
public Vector3 readVector3(int idx, VertexField field)
vector3 필드를 읽습니다.
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| idx | int | 읽을 정점의 인덱스 |
| field | VertexField | Vector3/FVector3 데이터 타입을 가진 필드 |
Returns: Vector3
readVector4(int idx, VertexField field)
public Vector4 readVector4(int idx, VertexField field)
vector4 필드를 읽습니다
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| idx | int | 읽을 정점의 인덱스 |
| field | VertexField | Vector4/FVector4 데이터 타입을 가진 필드 |
Returns: Vector4
removeProperty(Property property)
public boolean removeProperty(Property property)
동적 속성을 제거합니다.
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| property | Property | 제거할 속성 |
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:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| value | Node | 새 값 |
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()
vertices 데이터를 바이트 배열로 변환합니다
Returns: byte[]
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| arg0 | long | |
| arg1 | int |
write16bIndicesTo(Stream stream)
public void write16bIndicesTo(Stream stream)
indices 데이터를 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:
| 매개변수 | 형식 | 설명 |
|---|---|---|
| stream | Stream |
write16bIndicesTo(OutputStream stream)
public void write16bIndicesTo(OutputStream stream)
indices 데이터를 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)
indices 데이터를 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)
indices 데이터를 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)
vertices 데이터를 지정된 스트림에 씁니다
**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)
vertices 데이터를 지정된 스트림에 씁니다
**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);