diff --git a/docs/api/core/Geometry.html b/docs/api/core/Geometry.html index 1e445ac3375842dbb4cae5c0402f501896d552ae..1b700af933b0157a6d0d92d41f12abfdff790e70 100644 --- a/docs/api/core/Geometry.html +++ b/docs/api/core/Geometry.html @@ -1,8 +1,28 @@

[name]

-
todo
+
Base class for geometries
+

Example

+ +// geometry with random points + +var geometry = new THREE.Geometry() + +for ( var i = 0; i < 10000; i ++ ) { + + var vertex = new THREE.Vertex(); + vertex.position.x = Math.random() * 1000 - 500; + vertex.position.y = Math.random() * 1000 - 500; + vertex.position.z = Math.random() * 1000 - 500; + + geometry.vertices.push( vertex ); + +} + +geometry.computeBoundingSphere(); + +

Constructor

[name]()

@@ -10,14 +30,137 @@

Properties

-

.[page:Vector3 todo]

+

.[page:Integer id]

+
+Unique number of this geometry instance +
+ +

.[page:Array vertices]

+
+Array of [page:Vertex vertices]. +
+ +

.[page:Array colors]

+
+Array of vertex [page:Color colors], matching number and order of vertices.
+Used in [page:ParticleSystem], [page:Line] and [page:Ribbon].
+[page:Mesh Meshes] use per-face-use-of-vertex colors embedded directly in faces. +
+ +

.[page:Array materials]

+
+Array of [page:Material materials]. +
+ +

.[page:Array faces]

+
+Array of [page:Face3 triangles] or/and [page:Face4 quads]. +
+ +

.[page:Array faceUvs]

+
+Array of face [page:UV] layers.
+Each UV layer is an array of [page:UV] matching order and number of faces. +
+ +

.[page:Array faceVertexUvs]

+
+Array of face [page:UV] layers.
+Each UV layer is an array of [page:UV] matching order and number of vertices in faces. +
+ +

.[page:Array morphTargets]

+
+Array of morph targets. Each morph target is JS object: +{ name: "targetName", vertices: [ new THREE.Vertex(), ... ] } +Morph vertices match number and order of primary vertices. +
+ +

.[page:Array morphColors]

+
+Array of morph colors. Morph colors have similar structure as morph targets, each color set is JS object: +morphColor = { name: "colorName", colors: [ new THREE.Color(), ... ] } +Morph colors can match either number and order of faces (face colors) or number of vertices (vertex colors). +
+ +

.[page:Array skinWeights]

+
+Array of skinning weights, matching number and order of vertices. +
+ +

.[page:Array skinIndices]

+
+Array of skinning indices, matching number and order of vertices. +
+ +

.[page:Object boundingBox]

+
+Bounding box. +{ min: new THREE.Vector3(), max: new THREE.Vector3() } +
+ +

.[page:Object boundingSphere]

+
+Bounding sphere. +{ radius: float } +
+ +

.[page:Boolean hasTangents]

+
+True if geometry has tangents. Set in [page:Geometry Geometry.computeTangents]. +
+ +

.[page:Boolean dynamic]

+
+Set to true if attribute buffers will need to change in runtime (using "dirty" flags).
+Unless set to true internal typed arrays corresponding to buffers will be deleted once sent to GPU. +

Methods

-

.todo( [page:Vector3 todo] )

+

.applyMatrix( [page:Matrix4 matrix] )

+
+Bakes matrix transform directly into vertex coordinates. +
+ +

.computeCentroids()

+
+Computes centroids for all faces. +
+ +

.computeFaceNormals()

+
+Computes face normals. +
+ +

.computeVertexNormals()

+
+Computes vertex normals by averaging face normals.
+Face normals must be existing / computed beforehand. +
+ +

.computeTangents()

+
+Computes vertex tangents.
+Based on http://www.terathon.com/code/tangent.html
+Geometry must have vertex [page:UV UVs] (layer 0 will be used). +
+ +

.computeBoundingBox()

+
+Computes bounding box of the geometry, updating [page:Geometry Geometry.boundingBox] attribute. +
+ +

.computeBoundingSphere()

+
+Computes bounding sphere of the geometry, updating [page:Geometry Geometry.boundingSphere] attribute. +
+ +

.mergeVertices()

-todo — todo
+Checks for duplicate vertices using hashmap.
+Duplicated vertices are removed and faces' vertices are updated.
diff --git a/docs/api/core/Geometry.rst b/docs/api/core/Geometry.rst deleted file mode 100644 index e99857220b074426b0973c8976cb5ea232bb4e14..0000000000000000000000000000000000000000 --- a/docs/api/core/Geometry.rst +++ /dev/null @@ -1,198 +0,0 @@ -Geometry - Base class for geometries ----------------------------------------- - -.. ............................................................................... -.. rubric:: Constructor -.. ............................................................................... - -.. class:: Geometry() - - Base class for geometries - - Encapsulates unique instances of vertex buffer objects in :class:`WebGLRenderer` - - -.. ............................................................................... -.. rubric:: Attributes -.. ............................................................................... - -.. attribute:: Geometry.id - - Unique number of this geometry instance - -.. attribute:: Geometry.boundingBox - - Bounding box - - :: - - boundingBox = { min: new THREE.Vector3(), max: new THREE.Vector3() } - -.. attribute:: Geometry.boundingSphere - - Bounding sphere - - :: - - boundingSphere = { radius: float } - -.. attribute:: Geometry.materials - - Array of :class:`materials ` - - Used with models containing multiple materials in a single geometry (with pass-through :class:`MeshFaceMaterial`) - - Face indices index into this array. - - -.. ............................................................................... -.. rubric:: Attribute buffers -.. ............................................................................... - -.. attribute:: Geometry.faces - - Array of faces (:class:`Face3`, :class:`Face4`) - -.. attribute:: Geometry.vertices - - Array of :class:`vertices ` - - Face indices index into this array. - -.. attribute:: Geometry.colors - - Array of vertex :class:`colors `, matching number and order of vertices. - - Used in :class:`ParticleSystem`, :class:`Line` and :class:`Ribbon`. - - :class:`Meshes ` use per-face-use-of-vertex colors embedded directly in faces. - -.. attribute:: Geometry.faceUvs - - Array of face UV layers. - Each UV layer is an array of :class:`UV` matching order and number of faces. - -.. attribute:: Geometry.faceVertexUvs - - Array of vertex UV layers. - Each UV layer is an array of :class:`UV` matching order and number of vertices in faces. - -.. attribute:: Geometry.morphTargets - - Array of morph targets. - Each morph target is JS object: - - :: - - morphTarget = { name: "targetName", vertices: [ new THREE.Vertex(), ... ] } - - Morph vertices match number and order of primary vertices. - -.. attribute:: Geometry.morphColors - - Array of morph colors. - Morph colors have similar structure as morph targets, each color set is JS object: - - :: - - morphColor = { name: "colorName", colors: [ new THREE.Color(), ... ] } - - Morph colors can match either number and order of faces (face colors) or number of vertices (vertex colors). - -.. attribute:: Geometry.skinWeights - - Array of skinning weights (:class:`Vector4`), matching number and order of vertices. - -.. attribute:: Geometry.skinIndices - - Array of skinning indices (:class:`Vector4`), matching number and order of vertices. - - -.. ............................................................................... -.. rubric:: Flags -.. ............................................................................... - -.. attribute:: Geometry.hasTangents - - True if geometry has tangents. Set in :func:`Geometry.computeTangents` - - ``default false`` - -.. attribute:: Geometry.dynamic - - Set to `true` if attribute buffers will need to change in runtime (using ``dirty`` flags). - - Unless set to true internal typed arrays corresponding to buffers will be deleted once sent to GPU. - - ``default false`` - - -.. ............................................................................... -.. rubric:: Methods -.. ............................................................................... - -.. function:: Geometry.applyMatrix( matrix ) - - Bakes matrix transform directly into vertex coordinates - - :param Matrix4 matrix: matrix transform - -.. function:: Geometry.computeCentroids() - - Computes centroids for all faces - -.. function:: Geometry.computeFaceNormals() - - Computes face normals - -.. function:: Geometry.computeVertexNormals() - - Computes vertex normals by averaging face normals. - - Face normals must be existing / computed beforehand. - -.. function:: Geometry.computeTangents() - - Computes vertex tangents - - Based on http://www.terathon.com/code/tangent.html - - Geometry must have vertex UVs (layer 0 will be used). - -.. function:: Geometry.computeBoundingBox() - - Computes bounding box of the geometry, updating :attr:`Geometry.boundingBox` attribute. - -.. function:: Geometry.computeBoundingSphere() - - Computes bounding sphere of the geometry, updating :attr:`Geometry.boundingSphere` attribute. - -.. function:: Geometry.mergeVertices() - - Checks for duplicate vertices using hashmap. - Duplicated vertices are removed and faces' vertices are updated. - -.. ............................................................................... -.. rubric:: Example -.. ............................................................................... - -:: - - // geometry with random points - // (useful for example with ParticleSystem) - - var n = 10000; - var geometry = new THREE.Geometry() - for ( var i = 0; i < n; i ++ ) { - - var x = THREE.MathUtils.randFloatSpread( 1000 ); - var y = THREE.MathUtils.randFloatSpread( 1000 ); - var z = THREE.MathUtils.randFloatSpread( 1000 ); - var position = new THREE.Vector3( x, y, z ); - var vertex = new THREE.Vertex( position ); - - geometry.vertices.push( vertex ); - - } - - geometry.computeBoundingSphere(); diff --git a/docs/api/core/Math.html b/docs/api/core/Math.html index 1e445ac3375842dbb4cae5c0402f501896d552ae..69b7a4d2e632c4dbce37afb18e84c3e4c301afef 100644 --- a/docs/api/core/Math.html +++ b/docs/api/core/Math.html @@ -1,23 +1,60 @@

[name]

-
todo
+
Math utility functions
-

Constructor

+

Methods

-

[name]()

+

.clamp( [page:Float x], [page:Float a], [page:Float b] ) [page:Float]

+
+x — Value to be clamped.
+a — Minimum value
+b — Maximum value. +
+
+Clamps the x to be between a and b. +
+

.clampBottom( [page:Float x], [page:Float a] ) [page:Float]

+
+x — Value to be clamped.
+a — Minimum value +
+
+Clamps the x to be larger than a. +
-

Properties

+

.mapLinear( [page:Float x], [page:Float a] ) [page:Float]

+
+x — Value to be mapped.
+a1 — Minimum value for range A.
+a2 — Maximum value for range A.
+b1 — Minimum value for range B.
+b2 — Maximum value for range B. +
+
+Linear mapping of x from range [a1, a2] to range [b1, b2]. +
-

.[page:Vector3 todo]

+

.random16() [page:Float]

+
+Random float from 0 to 1 with 16 bits of randomness.
+Standard Math.random() creates repetitive patterns when applied over larger space. +
+

.randInt( [page:Integer low], [page:Integer high] ) [page:Integer]

+
+Random integer from low to high interval. +
-

Methods

+

.randFloat( [page:Float low], [page:Float high] ) [page:Float]

+
+Random float from low to high interval. +
-

.todo( [page:Vector3 todo] )

+

.randFloatSpread( [page:Float range] ) [page:Float]

-todo — todo
+Random float from - range / 2 to range / 2 interval.
diff --git a/docs/api/core/Math.rst b/docs/api/core/Math.rst deleted file mode 100644 index bad6bbc4a0eda19e21116fbc83f3210be4dcdccf..0000000000000000000000000000000000000000 --- a/docs/api/core/Math.rst +++ /dev/null @@ -1,60 +0,0 @@ -Math - Math utility functions ------------------------------ - -.. ............................................................................... -.. rubric:: Methods -.. ............................................................................... - -.. function:: Math.clamp( x, a, b ) - - Clamps the x to be between a and b - - :param float x: value to be clamped - :param float a: minimum value - :param float b: maximum value - :returns: Clamped value - :rtype: float - -.. function:: Math.clampBottom( x, a ) - - Clamps the x to be larger than a - - :param float x: value to be clamped - :param float a: minimum value - :returns: Clamped value - :rtype: float - -.. function:: Math.mapLinear( x, a1, a2, b1, b2 ) - - Linear mapping of x from range to range - - :param float x: value to be mapped - :param float a1: minimum value for range A - :param float a2: maximum value for range A - :param float b1: minimum value for range B - :param float b2: maximum value for range B - :returns: mapped value - :rtype: float - -.. function:: Math.random16() - - Random float from <0, 1> with 16 bits of randomness - (standard Math.random() creates repetitive patterns when applied over larger space) - - :returns: Random float from <0, 1> with 16 bits of randomness - :rtype: float - -.. function:: Math.randInt( low, high ) - - :returns: Random integer from *low* to *high* interval - :rtype: integer - -.. function:: Math.randFloat( low, high ) - - :returns: Random float from *low* to *high* interval - :rtype: float - -.. function:: Math.randFloatSpread( range ) - - :returns: Random float from -range/2 to range/2 interval - :rtype: float diff --git a/docs/api/core/Vertex.html b/docs/api/core/Vertex.html index 1e445ac3375842dbb4cae5c0402f501896d552ae..dfeab5e28bc8e647eb28ecf5ac0eb27b90a7992d 100644 --- a/docs/api/core/Vertex.html +++ b/docs/api/core/Vertex.html @@ -1,6 +1,6 @@

[name]

-
todo
+

Constructor

@@ -10,15 +10,7 @@

Properties

-

.[page:Vector3 todo]

- - -

Methods

- -

.todo( [page:Vector3 todo] )

-
-todo — todo
-
+

.[page:Vector3 position]

Source

diff --git a/docs/api/core/Vertex.rst b/docs/api/core/Vertex.rst deleted file mode 100644 index 1eb503fed843558fc74a3e2212fb74a685eaee80..0000000000000000000000000000000000000000 --- a/docs/api/core/Vertex.rst +++ /dev/null @@ -1,14 +0,0 @@ -Vertex - Represents a vertex in space -------------------------------------- - -.. rubric:: Constructor - -.. class:: Vertex() - - Represents a vertex in space - -.. rubric:: Attributes - -.. rubric:: Method - -.. rubric:: Example(s) \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 36ba88de2fb0183e0eaf5306baeae00ef23c386d..b2a221d5b9a81dcbafcf84a61e0915d8dd1e3d14 100644 --- a/docs/index.html +++ b/docs/index.html @@ -351,7 +351,7 @@ text = text.replace(/\[name\]/gi, name); text = text.replace(/\[path\]/gi, path); text = text.replace(/\[page:(\w+)\]/gi, "$1" ); - text = text.replace(/\[page:(\w+) (\w+)\]/gi, "$2" ); + text = text.replace(/\[page:(\w+) ([\w|\.]+)\]/gi, "$2" ); viewer.innerHTML = '
' + text + '

';