r - the red component of the color if arguments g and b are defined. If they are not defined, it can be a hexadecimal or a CSS-style string or a Color instance.<br/>
g - The green component of the color if it is defined.<br/>
b - The blue component of the color if it is defined.
</div>
<div>
All arguments are optional. The default color is White.<br/>
[page:Multi r] - (optional) the red component of the color if arguments g and b are defined.
If they are not defined, it can be a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] (recommended) or a CSS-style string or another Color instance.<br/>
[page:Float g] - (optional) The green component of the color if it is defined.<br/>
[page:Float b] - (optional) The blue component of the color if it is defined.<br/><br/>
Note that standard method of specifying color in Three is with a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet], and that method is used
throughout the rest of the documentation.<br/><br/>
When all arguments are defined then r is the red component, g is the green component and b is the blue component of the color.<br/>
When only r is defined:<br/>
<ul>
<li>It can be a hexadecimal of the color.</li>
<li>It can be an another color instance.</li>
<li>It can be a CSS style. For Instance:
<li>It can be a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] representing the color (recommended).</li>
<li>It can be an another Color instance.</li>
<li>It can be a CSS style string. For Instance:
<ul>
<li>rgb(250, 0,0)</li>
<li>rgb(100%,0%,0%)</li>
<li>hsl(0, 100%, 50%)</li>
<li>#ff0000</li>
<li>#f00</li>
<li>red</li>
<li>'rgb(250, 0,0)'</li>
<li>'rgb(100%,0%,0%)'</li>
<li>'hsl(0, 100%, 50%)'</li>
<li>'#ff0000'</li>
<li>'#f00'</li>
<li>'red'</li>
</ul>
</li>
...
...
@@ -56,6 +75,13 @@
<h2>Properties</h2>
<h3>[property:Boolean isColor]</h3>
<div>
Used to check whether this or derived classes are Colors. Default is *true*.<br/><br/>
You should not change this, as it used internally for optimisation.
</div>
<h3>[property:Float r]</h3>
<div>
Red channel value between 0 and 1. Default is 1.
...
...
@@ -71,183 +97,182 @@
Blue channel value between 0 and 1. Default is 1.
</div>
<h2>Methods</h2>
<h3>[method:Color set]( value ) [page:Color this]</h3>
<div>
value -- either an instance of [page:Color], a [page:Integer hexadecimal] value, or a css style [page:String string]
</div>
<div>
Delegates to .copy, .setStyle, or .setHex depending on input type.
Sets this color from a CSS-style string. For example, "rgb(250, 0,0)", "rgb(100%, 0%, 0%)", "hsl(0, 100%, 50%)", "#ff0000", "#f00", or "red". Transluent colors such as "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" are also accepted, but the alpha-channel coordinate will be discarded.
</div>
<h3>[method:String getStyle]()</h3>
<div>
Returns the value of this color as a CSS-style string. Example: rgb(255,0,0)
</div>
<div>Returns the value of this color as a CSS-style string. Example: 'rgb(255,0,0)'.</div>
Linear interpolation of this colors rgb values and the rgb values of the first argument. The alpha argument can be thought of as the percent between the two colors, where 0 is this color and 1 is the first argument.
[page:Float r] — Red channel value between 0 and 1.<br/>
[page:Float g] — Green channel value between 0 and 1.<br/>
[page:Float b] — Blue channel value between 0 and 1.<br/><br/>
Resets the euler angle with a new order by creating a quaternion from this euler angle and then setting this euler angle with the quaternion and the new order. <br/>
WARNING: this discards revolution information.
The current value of the z component.<br/><br/>
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
<divclass="desc"><ahref="http://en.wikipedia.org/wiki/Frustum">Frustums</a> are used to determine what is inside the camera's field of view. They help speed up the rendering process.</div>
<divclass="desc">
[link:http://en.wikipedia.org/wiki/Frustum Frustums] are used to determine what is
inside the camera's field of view. They help speed up the rendering process - object which lie
outside a camera's frustum can safely be excluded from rendering.<br/><br/>
This class is mainly intended for use internally by a renderer for calculating
a [page:Camera camera] or [page:LightShadow.camera shadowCamera]'s frustum.
Returns a point parameter based on the closest point as projected on the line segement. If clamp to line is true, then the returned value will be between 0 and 1.
Sets the start and end values by copying the provided vectors.
Sets this matrix as the normal matrix (upper left 3x3)of the passed [page:Matrix4 matrix4]. The normal matrix is the inverse transpose of the matrix *m*.
Sets the elements of this matrix based on an array in
Set this matrix to the inverse of the passed matrix.
[page:Matrix4 m] - [page:Matrix4]<br/><br/>
Sets this matrix as the upper left 3x3 of the [link:https://en.wikipedia.org/wiki/Normal_matrix normal matrix]
of the passed [page:Matrix4 matrix4]. The normal matrix is the [link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] [link:https://en.wikipedia.org/wiki/Transpose transpose]
Determines whether or not this plane intersects *sphere*.
Checks to see if two planes are equal (their [page:.normal normal] and
[page:.constant constant] properties match).
</div>
<h3>[method:Vector3 intersectLine]( [page:Line3 line], [page:Vector3 optionalTarget] ) or [page:undefined]</h3>
<div>
line -- [page:Line3] <br/>
optionalTarget -- [page:Vector3]
</div>
<div>
Returns the intersection point of the passed line and the plane. Returns undefined if the line does not intersect. Returns the line's starting point if the line is coplanar with the plane.
</div>
[page:Line3 line] - the [page:Line3] to check for intersection.<br/>
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
otherwise a new [page:Vector3] will be created.<br/><br/>
Projects a point onto the plane. The projected point is the closest point on the plane to the passed point, so a line drawn from the projected point and the passed point would be orthogonal to the plane.
[page:Vector3 point] - the [page:Vector3] to project onto the plane.<br/>
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3],
otherwise a new [page:Vector3] will be created.<br/><br/>
Projects a [page:Vector3 point] onto the plane. The projected point is the closest
point on the plane to the passed point, so a line drawn from the projected point
and the passed point would be orthogonal to the plane.
Translates the plane the distance defined by the vector. Note that this only affects the constant (distance from origin) and will not affect the normal vector.
[page:Vector3 a] - first point on the plane.<br/>
[page:Vector3 a] - second point on the plane.<br/>
[page:Vector3 a] - third point on the plane.<br/><br/>
Defines the plane based on the 3 provided points. The winding order is counter
clockwise, and determines which direction the [page:.normal normal] will point.
<divclass="desc">Implementation of a <ahref="http://en.wikipedia.org/wiki/Quaternion">quaternion</a>. This is used for rotating things without encountering the dreaded <ahref="http://en.wikipedia.org/wiki/Gimbal_lock">gimbal lock</a> issue, amongst other advantages.</div>
<divclass="desc">
Implementation of a [link:http://en.wikipedia.org/wiki/Quaternion quaternion].
This is used for [link:https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation rotating things]
without encountering the dreaded
[link:http://en.wikipedia.org/wiki/Gimbal_lock gimbal lock] issue, amongst other
origin -- [page:Vector3] The origin of the [page:Ray].<br/>
direction -- [page:Vector3] The direction of the [page:Ray]. This must be normalized (with [page:Vector3].normalize) for the methods to operate properly.
</div>
<div>
Initialises the origin and direction properties to the provided values.
[page:Vector3 origin] - (optional) the origin of the [page:Ray]. Default is a [page:Vector3] at (0, 0, 0).<br/>
[page:Vector3 direction] - [page:Vector3] The direction of the [page:Ray]. This must be normalized
(with [page:Vector3.normalize]) for the methods to operate properly. Default is a [page:Vector3] at (0, 0, 0).<br/><br/>
Creates a new [name].
</div>
<h2>Properties</h2>
<h3>[property:Vector3 origin]</h3>
<div>
The origin of the [page:Ray].
</div>
<div>The origin of the [page:Ray]. Default is a [page:Vector3] at (0, 0, 0).</div>
<h3>[property:Vector3 direction]</h3>
<div>
The direction of the [page:Ray]. This must be normalized (with [page:Vector3].normalize) for the methods to operate properly.
The direction of the [page:Ray]. This must be normalized (with [page:Vector3.normalize])
for the methods to operate properly. Default is a [page:Vector3] at (0, 0, 0).
origin -- [page:Vector3] The origin of the [page:Ray].<br/>
direction -- [page:Vector3] The direction of the [page:Ray]. This must be normalized (with [page:Vector3].normalize) for the methods to operate properly.
</div>
<div>
Copy the parameters to the origin and direction properties.
</div>
[page:Vector3 origin] - the [page:.origin origin] of the [page:Ray].<br/>
[page:Vector3 origin] - the [page:.direction direction] of the [page:Ray].
This must be normalized (with [page:Vector3.normalize]) for the methods to operate
properly.<br/><br/>
<h3>[method:Ray lookAt]( [page:Vector3 v] )</h3>
<div>
v -- [page:Vector3] The vector to look at.
</div>
<div>
Adjusts the direction of the ray to point at the vector in world coordinates.
Copy the parameters to the [page:.origin origin] and [page:.direction direction] properties
Computes the minimum bounding sphere for *points*. If *optionalCenter* is given, it is used as the sphere's center. Otherwise, the center of the axis-aligned bounding box encompassing *points* is calculated.
Copies the values of the passed sphere's [page:.center center] and [page:.radius radius]
Checks to see if the sphere contains the provided point inclusive of the edge of the sphere.
[page:Box3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Box3] will be created.<br/><br/>
Returns a[link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Box] for the sphere.
a — array of triplets containing x, y, z coordinates<br/>
</div>
<div>Initialises using the data in the array as a series of points. Each value in *a* must be another array with three values, where a[n] is v, the value for the *nth* point, and v[0], v[1] and v[2] are the x, y and z coordinates of that point n, respectively.
Returns an array with triplets of [ x, y, z ] coordinates that correspond to the
samplingCoef — how many intermediate values to use between spline points
[page:Float samplingCoef] — how many intermediate values to use between spline points<br/><br/>
Modifies the spline so that it looks similar to the original but has its points distributed
in such way that moving along the spline it's done at a more or less constant speed.
The points should also appear more uniformly spread along the curve.
This is done by resampling the original spline, with the density of sampling controlled by [page:Float samplingCoef].
Here it's interesting to note that denser sampling is not necessarily better:
if sampling is too high, you may get weird kinks in curvature.
</div>
<div>Modifies the spline so that it looks similar to the original but has its points distributed in such way that moving along the spline it's done at a more or less constant speed. The points should also appear more uniformly spread along the curve.</div>
<div>This is done by resampling the original spline, with the density of sampling controlled by *samplingCoef*. Here it's interesting to note that denser sampling is not necessarily better: if sampling is too high, you may get weird kinks in curvature.</div>
Sets the triangle's vectors to the vectors in the array.
</div>
[page:Vector3 point] - [page:Vector3] <br/>
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Vector3] will be created.<br/><br/>
optionalTarget -- Optional [page:Vector3] target to set the result.
point - [page:Vector3] <br/>
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Vector3] will be created.<br/><br/>
Returns the closest point on the triangle to [page:Vector3 point].
optionalTarget -- Optional [page:Vector3] target to set the result.
</div>
<div>
Return the midpoint of the triangle. Optionally sets a target vector.
</div>
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Vector3] will be created.<br/><br/>
Checks to see if two triangles are equal (share the same vectors).
[page:Vector3 optionalTarget] - (optional) if specified, the result will be copied into this [page:Vector3], otherwise a new [page:Vector3] will be created.<br/><br/>
Calculate the [link:https://en.wikipedia.org/wiki/Normal_(geometry) normal vector] of the triangle.
optionalTarget -- Optional [page:Plane] target to set the result.
</div>
<div>
Return a [page:Plane plane] based on the triangle. Optionally sets a target plane.
</div>
[page:Plane optionalTarget] - (optional) if specified, the result will be copied into this [page:Plane], otherwise a new [page:Plane] will be created.<br/><br/>