123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- <!DOCTYPE html>
- <html lang="ko">
- <head>
- <meta charset="utf-8" />
- <base href="../../../" />
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- <h1>[name]</h1>
- <p>
- 메쉬, 선, 점 기하학의 표현입니다. 꼭짓점의 위치, 면 순서, 법선, 색상, UV, 버퍼에 있는 커스텀 속성을 포함하고 있으며, 데이터를 GPU에 전달하는
- 자원을 줄여줍니다.
- </p>
- <p>
- 속성에 있는 데이터를 읽고 수정하려면, [page:BufferAttribute] 문서를 참고하세요.
- </p>
- <h2>코드 예제</h2>
- <code>
- const geometry = new THREE.BufferGeometry();
- // create a simple square shape. We duplicate the top left and bottom right
- // vertices because each vertex needs to appear once per triangle.
- const vertices = new Float32Array( [
- -1.0, -1.0, 1.0,
- 1.0, -1.0, 1.0,
- 1.0, 1.0, 1.0,
- 1.0, 1.0, 1.0,
- -1.0, 1.0, 1.0,
- -1.0, -1.0, 1.0
- ] );
- // itemSize = 3 because there are 3 values (components) per vertex
- geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
- const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
- const mesh = new THREE.Mesh( geometry, material );
- </code>
- <h2>예제</h2>
- <p>
- [example:webgl_buffergeometry Mesh with non-indexed faces]<br />
- [example:webgl_buffergeometry_indexed Mesh with indexed faces]<br />
- [example:webgl_buffergeometry_lines Lines]<br />
- [example:webgl_buffergeometry_lines_indexed Indexed Lines]<br />
- [example:webgl_buffergeometry_custom_attributes_particles Particles]<br />
- [example:webgl_buffergeometry_rawshader Raw Shaders]
- </p>
- <h2>생성자</h2>
- <h3>[name]()</h3>
- <div>
- 새 [name]를 만듭니다. 몇몇 기본값도 설정합니다.
- </div>
- <h2>프로퍼티</h2>
- <h3>[property:Object attributes]</h3>
- <p>
- 이 해시맵은 설정될 속성의 이름을 id로 가지고 있으며 설정해야 할 [page:BufferAttribute buffer] 값을 value로 가지고 있습니다.
- 프로퍼티에 직접 접근하기보다, [page:.setAttribute] 및 [page:.getAttribute]를 통해 이 기하학 속성에 접근하세요.
- </p>
- <h3>[property:Box3 boundingBox]</h3>
- <p>
- bufferGeometry의 바운딩 박스이며 [page:.computeBoundingBox]()로 계산할 수 있습니다.
- 기본값은 *null*입니다.
- </p>
- <h3>[property:Sphere boundingSphere]</h3>
- <p>
- bufferGeometry의 바운딩 스피어이며 [page:.computeBoundingSphere]()로 계산할 수 있습니다.
- 기본값은 *null*입니다.
- </p>
- <h3>[property:Object drawRange]</h3>
- <p>
- 렌더링할 기하학의 부분을 정의합니다. 직접 설정하면 안되며 [page:.setDrawRange]를 사용해야 합니다.
- 기본 값은 다음과 같습니다.
- <code>
- { start: 0, count: Infinity }
- </code>
- 인덱스가 없는 BufferGeometry의 경우, count는 렌더링할 꼭짓점들의 갯수입니다.
- 인덱스가 있는 BufferGeometry의 경우, count는 렌더링할 인덱스의 갯수입니다.
- </p>
- <h3>[property:Array groups]</h3>
- <p>
- 기하학을 그룹으로 나누며 각자의 WebGL 그리기 요청을 통해 렌더링 됩니다.
- bufferGeometry와 함께 사용되는 재질의 배열을 허용합니다..<br /><br />
- 각자의 그룹은 형태의 객체입니다:
- <code>{ start: Integer, count: Integer, materialIndex: Integer }</code>
- start는 이 드리기 요청에서 첫 번째 엘레먼드를 지정하지만 – 첫 번째 인덱스가 없는 기하학이기때문이지만,
- 다른 경우는 첫 번째 삼각형 인덱스입니다. Count는 몇 개의 꼭짓점(혹은 인덱스)가 포함되었는지,
- materialIndex는 사용할 재질 배열 인덱스를 지정합니다.
- 배열을 직접 수정하기보다는 [page:.addGroup]를 사용해 그룹을 추가합니다.
- </p>
- <!-- Note: groups used to be called drawCalls
- <h3>[property:Array drawcalls]</h3>
- <p>
- For geometries that use indexed triangles, this Array can be used to split the object
- into multiple WebGL draw calls. Each draw call will draw some subset of the vertices
- in this geometry using the configured [page:Material shader]. This may be necessary if,
- for instance, you have more than 65535 vertices in your object.
- </p> -->
- <h3>[property:Integer id]</h3>
- <p>인스턴스의 고유한 번호입니다.</p>
- <h3>[property:BufferAttribute index]</h3>
- <p>
- 꼭짓점을 여러 개의 삼각형으로 재 사용할 수 있게 해줍니다; 이를 "indexed triangles"를 사용한다고 합니다.
- 각각의 삼각형은 세 꼭짓점의 인덱스와 연관되어 있습니다. 이 속성은 따라서 각 삼각형 면의 각 꼭짓점의 인덱스를 저장하고 있습니다.
- 이 속성이 설정되어 있지 않다면, [page:WebGLRenderer renderer]는 세 연속된 위치가 단일 삼각형을 나타낸다고 추정합니다.
- 기본값은 *null* 입니다.
- </p>
- <h3>[property:Boolean isBufferGeometry]</h3>
- <p>
- Read-only flag to check if a given object is of type [name].
- </p>
- <h3>[property:Object morphAttributes]</h3>
- <p>
- [page:BufferAttribute]의 해쉬맵은 기하학의 모프 타겟에 대한 세부정보를 담고 있습니다.<br />
- Note: Once the geometry has been rendered, the morph attribute data cannot be changed. You will have to call [page:.dispose](), and create a new instance of [name].
- </p>
- <h3>[property:Boolean morphTargetsRelative]</h3>
- <p>
- 모프 타겟의 행동을 컨트롤하는데에 사용됩니다; true로 설정하면, 모프 타겟 데이터는 absolute positions/normals 대신 relative offsets으로 취급됩니다.
- 기본값은 *false* 입니다.
- </p>
- <h3>[property:String name]</h3>
- <p>
- 인스턴스의 임의 이름입니다. 기본값은 빈 문자열입니다.
- </p>
- <h3>[property:Object userData]</h3>
- <p>
- BufferGeometry에 관한 커스텀 데이터를 저장하는데에 사용될 수 있는 객체입니다. 이 속성은 복제되지 않기 때문에
- 기능에 대한 참조를 포함하고 있어서는 안됩니다.
- </p>
- <h3>[property:String uuid]</h3>
- <p>
- 객체 인스턴스의 [link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID]입니다.
- 자동으로 할당되며 수정할 수 없습니다.
- </p>
- <h2>메서드</h2>
- <p>이 클래스에서는 [page:EventDispatcher EventDispatcher] 메서드들이 활용 가능합니다.</p>
- <h3>[method:this setAttribute]( [param:String name], [param:BufferAttribute attribute] )</h3>
- <p>
- 기하학에 대한 속성을 설정합니다. [page:.attributes]의 내부 해시맵은 속성들의 반복 속도 증가를 위해 유지되기 때문에,
- 속성 프로퍼티 대신 이 메서드를 사용하세요.
- </p>
- <h3>[method:undefined addGroup]( [param:Integer start], [param:Integer count], [param:Integer materialIndex] )</h3>
- <p>
- 기하학에 그룹을 추가합니다; 프로퍼티 상세에 대해서는 [page:BufferGeometry.groups groups] 페이지를 참고하세요.
- </p>
- <h3>[method:this applyMatrix4]( [param:Matrix4 matrix] )</h3>
- <p>꼭짓점 좌표로 직접 매트릭스 변형을 합니다.</p>
- <h3>[method:this center] ()</h3>
- <p>바운딩 박스를 기준으로 기하학을 중앙정렬합니다.</p>
- <h3>[method:BufferGeometry clone]()</h3>
- <p>BufferGeometry의 사본을 만듭니다.</p>
- <h3>[method:this copy]( [param:BufferGeometry bufferGeometry] )</h3>
- <p>다른 BufferGeometry를 이 BufferGeometry에 복사합니다.</p>
- <h3>[method:undefined clearGroups]( )</h3>
- <p>모든 그룹을 제거합니다.</p>
- <h3>[method:undefined computeBoundingBox]()</h3>
- <p>
- 기하학의 바운딩 박스를 계산하고 [page:.boundingBox] 속성을 업데이트합니다.<br />
- 바운딩 박스는 자동으로 계산되지 않습니다. 명시적으로 계산되어야하며 그렇지 않으면 *null* 값입니다.
- </p>
- <h3>[method:undefined computeBoundingSphere]()</h3>
- <p>
- 기하학의 바운딩 스피어를 계산하고 [page:.boundingSphere] 속성을 업데이트합니다.<br />
- 바운딩 스피어는 자동으로 계산되지 않습니다. 명시적으로 계산되어야하며 그렇지 않으면 *null* 값입니다.
- </p>
- <h3>[method:undefined computeTangents]()</h3>
- <p>
- 기하학에 탄젠트 속성을 계산하고 추가합니다.<br />
- 이 계산은 인덱스가 있는 기하학에만 지원되며 위치, 법선, uv 속성이 정의되어야 합니다.
- When using a tangent space normal map, prefer the MikkTSpace algorithm provided by
- [page:BufferGeometryUtils.computeMikkTSpaceTangents] instead.
- </p>
- <h3>[method:undefined computeVertexNormals]()</h3>
- <p>면의 법선 평균값을 통해 꼭짓점 법선을 계산합니다.</p>
- <h3>[method:undefined dispose]()</h3>
- <p>
- 메모리에서 객체를 정리합니다. <br />
- 앱이 동작중인데 BufferGeometry를 삭제하고 싶을 때 호출합니다.
- </p>
- <h3>[method:BufferAttribute getAttribute]( [param:String name] )</h3>
- <p>[page:BufferAttribute attribute]를 특정 이름과 함께 리턴합니다.</p>
- <h3>[method:BufferAttribute getIndex] ()</h3>
- <p>[page:.index] 버퍼를 리턴합니다.</p>
- <h3>[method:Boolean hasAttribute]( [param:String name] )</h3>
- <p>특정 이름의 속성이 존재하면 *true*를 리턴합니다.</p>
- <h3>[method:this lookAt] ( [param:Vector3 vector] )</h3>
- <p>
- vector - 바라보는 시점의 월드 벡터 입니다.<br /><br />
- 공간의 점을 기준으로 기하학을 면을 회전시킵니다. 일반적으로 한 구간에서만 사용되며 루프 구간에서 사용되지 않습니다.
- 일반적인 리얼타임 메쉬 사용은 [page:Object3D.lookAt] 을 사용하세요.
- </p>
- <h3>[method:undefined normalizeNormals]()</h3>
- <p>
- 기하학의 모든 법선 벡터는 1의 크기를 갖습니다.
- 기하학 표면의 광도를 수정합니다.
- </p>
- <h3>[method:BufferAttribute deleteAttribute]( [param:String name] )</h3>
- <p>특정 이름의 [page:BufferAttribute attribute]를 전부 삭제합니다.</p>
- <h3>[method:this rotateX] ( [param:Float radians] )</h3>
- <p>
- X 축의 기하학을 회전합니다. 일반적으로 한 구간에서만 사용되며 루프 구간에서 사용되지 않습니다.
- 일반적인 리얼타임 메쉬 회전은 [page:Object3D.rotation] 를 사용하세요.
- </p>
- <h3>[method:this rotateY] ( [param:Float radians] )</h3>
- <p>
- Y 축의 기하학을 회전합니다. 일반적으로 한 구간에서만 사용되며 루프 구간에서 사용되지 않습니다.
- 일반적인 리얼타임 메쉬 회전은 [page:Object3D.rotation] 를 사용하세요.
- </p>
- <h3>[method:this rotateZ] ( [param:Float radians] )</h3>
- <p>
- Z 축의 기하학을 회전합니다. 일반적으로 한 구간에서만 사용되며 루프 구간에서 사용되지 않습니다.
- 일반적인 리얼타임 메쉬 회전은 [page:Object3D.rotation] 를 사용하세요.
- </p>
- <h3>[method:this scale] ( [param:Float x], [param:Float y], [param:Float z] )</h3>
- <p>
- 기하학 데이터를 확대/축소합니다. 일반적으로 한 구간에서만 사용되며 루프 구간에서 사용되지 않습니다.
- 일반적인 리얼타임 메쉬 확대/축소는 [page:Object3D.scale] 를 사용하세요.
- </p>
- <h3>[method:this setIndex] ( [param:BufferAttribute index] )</h3>
- <p>[page:.index] 버퍼를 설정합니다.</p>
- <h3>[method:undefined setDrawRange] ( [param:Integer start], [param:Integer count] )</h3>
- <p>[page:.drawRange] 프로퍼티를 설정합니다. 인덱스가 없는 BufferGeometry에서, count는 렌더링할 꼭짓점의 수입니다.
- 인덱스가 있는 BufferGeometry에서 count는 렌더링할 인덱스의 수입니다.</p>
- <h3>[method:this setFromPoints] ( [param:Array points] )</h3>
- <p>점 배열로부터 BufferGeometry의 속성을 설정합니다. from an array of points.</p>
- <h3>[method:Object toJSON]()</h3>
- <p>버퍼 기하학을 three.js [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format]로 변환합니다.</p>
- <h3>[method:BufferGeometry toNonIndexed]()</h3>
- <p>인덱스가 있는 BufferGeometry의 인덱스가 없는 버전을 리턴합니다.</p>
- <h3>[method:this translate] ( [param:Float x], [param:Float y], [param:Float z] )</h3>
- <p>
- 기하학을 이동합니다. 일반적으로 한 구간에서만 사용되며 루프 구간에서 사용되지 않습니다.
- 일반적인 리얼타임 메쉬 이동은 [page:Object3D.position] 를 사용하세요.
- </p>
- <h2>소스코드</h2>
- <p>
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </p>
- </body>
- </html>
|