未验证 提交 fe3f882c 编写于 作者: D Don McCurdy 提交者: GitHub

Merge branch 'dev' into feat-gltfloader-node-weights

......@@ -19,7 +19,7 @@ Please also include a live example if possible. You can start from these templat
##### Three.js version
- [ ] Dev
- [ ] r97
- [ ] r99
- [ ] ...
##### Browser
......
three.js
========
[![Latest NPM release][npm-badge]][npm-badge-url]
[![License][license-badge]][license-badge-url]
[![Dependencies][dependencies-badge]][dependencies-badge-url]
[![Dev Dependencies][devDependencies-badge]][devDependencies-badge-url]
[![Build Status](https://travis-ci.org/mrdoob/three.js.svg?branch=dev)](https://travis-ci.org/mrdoob/three.js)
[![Language Grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/mrdoob/three.js.svg?label=code%20quality)](https://lgtm.com/projects/g/mrdoob/three.js/)
[![NPM package][npm]][npm-url]
[![Build Size][build-size]][build-size-url]
[![Build Status][build-status]][build-status-url]
[![Dependencies][dependencies]][dependencies-url]
[![Dev Dependencies][dev-dependencies]][dev-dependencies-url]
[![Language Grade][lgtm]][lgtm-url]
#### JavaScript 3D library ####
......@@ -77,11 +77,15 @@ If everything went well you should see [this](https://jsfiddle.net/f2Lommf5/).
[Releases](https://github.com/mrdoob/three.js/releases)
[npm-badge]: https://img.shields.io/npm/v/three.svg
[npm-badge-url]: https://www.npmjs.com/package/three
[license-badge]: https://img.shields.io/npm/l/three.svg
[license-badge-url]: ./LICENSE
[dependencies-badge]: https://img.shields.io/david/mrdoob/three.js.svg
[dependencies-badge-url]: https://david-dm.org/mrdoob/three.js
[devDependencies-badge]: https://img.shields.io/david/dev/mrdoob/three.js.svg
[devDependencies-badge-url]: https://david-dm.org/mrdoob/three.js#info=devDependencies
[npm]: https://img.shields.io/npm/v/three.svg
[npm-url]: https://www.npmjs.com/package/three
[build-size]: https://badgen.net/bundlephobia/minzip/three
[build-size-url]: https://bundlephobia.com/result?p=three
[build-status]: https://travis-ci.org/mrdoob/three.js.svg?branch=dev
[build-status-url]: https://travis-ci.org/mrdoob/three.js
[dependencies]: https://img.shields.io/david/mrdoob/three.js.svg
[dependencies-url]: https://david-dm.org/mrdoob/three.js
[dev-dependencies]: https://img.shields.io/david/dev/mrdoob/three.js.svg
[dev-dependencies-url]: https://david-dm.org/mrdoob/three.js#info=devDependencies
[lgtm]: https://img.shields.io/lgtm/grade/javascript/g/mrdoob/three.js.svg?label=code%20quality
[lgtm-url]: https://lgtm.com/projects/g/mrdoob/three.js/
因为 它太大了无法显示 source diff 。你可以改为 查看blob
此差异已折叠。
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -96,10 +96,7 @@
<p>
Returns an array of new AnimationClips created from the [page:Geometry.morphTargets morph
target sequences] of a geometry, trying to sort morph target names into animation-group-based
patterns like "Walk_001, Walk_002, Run_001, Run_002 ..."<br /><br />
This method is called by the [page:JSONLoader] internally, and it uses
[page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence].
patterns like "Walk_001, Walk_002, Run_001, Run_002 ...".
</p>
<h3>[method:AnimationClip CreateFromMorphTargetSequence]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3>
......
......@@ -62,6 +62,9 @@
<h3>[property:AudioContext context]</h3>
<p>The [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext] of the [page:AudioListener listener] given in the constructor.</p>
<h3>[property:Number detune]</h3>
<p>Modify pitch, measured in cents. +/- 100 is a semitone. +/- 1200 is an octave. Default is *0*.</p>
<h3>[property:Array filters]</h3>
<p>Represents an array of [link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNodes]. Can be used to apply a variety of low-order filters to create more complex sound effects. Filters are set via [page:Audio.setFilter] or [page:Audio.setFilters].</p>
......@@ -73,12 +76,15 @@
<p>Whether playback can be controlled using the [page:Audio.play play](),
[page:Audio.pause pause]() etc. methods. Default is *true*.</p>
<h3>[property:Number playbackRate]</h3>
<p>Speed of playback. Default is *1*.</p>
<h3>[property:Boolean isPlaying]</h3>
<p>Whether the audio is currently playing.</p>
<h3>[property:AudioListener listener]</h3>
<p>A reference to the listener object of this audio.</p>
<h3>[property:Number playbackRate]</h3>
<p>Speed of playback. Default is *1*.</p>
<h3>[property:Number startTime]</h3>
<p>The time at which the sound should begin to play. Same as the *when* paramter of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start](). Default is *0*.</p>
......
......@@ -67,6 +67,8 @@
<h3>[property:AudioNode filter]</h3>
<p>Default is *null*.</p>
<h3>[property:Number timeDelta]</h3>
<p>Time delta value for audio entities. Use in context of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime AudioParam.linearRampToValueAtTimeDefault](). Default is *0*.</p>
<h2>Methods</h2>
......
......@@ -119,12 +119,13 @@
<h3>[property:Object drawRange]</h3>
<p>
Used to determine what part of the geometry should be rendered. This should not
be set directly, instead use [page:.setDrawRange].<br />
Default is
Determines the part of the geometry to render. This should not
be set directly, instead use [page:.setDrawRange]. Default is
<code>
{ start: 0, count: Infinity }
</code>
For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.
</p>
<h3>[property:Array groups]</h3>
......@@ -232,7 +233,7 @@
<h3>[method:null computeBoundingBox]()</h3>
<p>
Computes bounding box of the geometry, updating [param:.boundingBox] attribute.<br />
Computes bounding box of the geometry, updating [page:.boundingBox] attribute.<br />
Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are *null*.
</p>
......@@ -316,7 +317,8 @@
<p>Set the [page:.index] buffer.</p>
<h3>[method:null setDrawRange] ( [param:Integer start], [param:Integer count] )</h3>
<p>Set the [page:.drawRange] buffer. See that property for details.</p>
<p>Set the [page:.drawRange] property. For non-indexed BufferGeometry, count is the number of vertices to render.
For indexed BufferGeometry, count is the number of indices to render.</p>
<h3>[method:BufferGeometry setFromObject] ( [param:Object3D object] )</h3>
<p>Sets the attributes for this BufferGeometry from an [page:Object3D].</p>
......
......@@ -19,7 +19,6 @@
<h2>Examples</h2>
<p>[example:misc_ubiquity_test ubiquity / test ]</p>
<p>[example:svg_sandbox svg / sandbox ]</p>
<p>[example:misc_exporter_obj exporter / obj ]</p>
<p>[example:webgl_shaders_vector WebGL / shaders / vector ]</p>
......
......@@ -266,7 +266,9 @@
</p>
<h3>[method:Geometry fromBufferGeometry]( [param:BufferGeometry geometry] )</h3>
<p>Convert a [page:BufferGeometry] to a Geometry.</p>
<p>Convert a [page:BufferGeometry] to a Geometry. <br />
When converting from BufferGeometry to Geometry, all vertices are preserved, so duplicated vertices may appear.
Use [page:Geometry.mergeVertices] to remove them.</p>
<h3>[method:Geometry lookAt] ( [param:Vector3 vector] )</h3>
<p>
......
......@@ -286,7 +286,7 @@
Rotates the object to face a point in world space.<br /><br />
This method does not support objects with rotated and/or translated parent(s).
This method does not support objects having non-uniformly-scaled parent(s).
</p>
<h3>[method:Array raycast]( [param:Raycaster raycaster], [param:Array intersects] )</h3>
......
......@@ -245,24 +245,13 @@
Light.shadowMapHeight is now [page:Light.shadow.mapSize.height].
</p>
<h2>Loaders</h2>
<h3>[page:XHRLoader]</h3>
<p>XHRLoader has been renamed to [page:FileLoader].</p>
<h3>[page:JSONLoader]</h3>
<p>JSONLoader has been removed from core.</p>
<h2>Maths</h2>
......@@ -494,11 +483,10 @@
Shape.makeGeometry has been removed. Use [page:ShapeGeometry] instead.
</p>
<h3>[page:SkinnedMesh]</h3>
<p>
SkinnedMesh.initBones() has been removed.
</p>
<h2>Renderers</h2>
......
......@@ -41,7 +41,6 @@
<h2>Example</h2>
<p>
[example:misc_controls_fly controls / fly ]<br />
[example:misc_lights_test lights / test ]<br />
[example:webvr_cubes cubes ]<br />
[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]<br />
[example:webgl_effects_stereo effects / stereo ]<br />
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<p class="desc">
A loader for loading objects in JSON format.
This uses the [page:FileLoader] internally for loading files.
</p>
<h2>Example</h2>
<p>
[example:webgl_loader_json WebGL / loader / json]<br />
[example:webgl_loader_json_objconverter WebGL / loader / json / objconverter]
</p>
<code>
// instantiate a loader
var loader = new THREE.JSONLoader();
// load a resource
loader.load(
// resource URL
'models/animated/monster/monster.js',
// onLoad callback
function ( geometry, materials ) {
var material = materials[ 0 ];
var object = new THREE.Mesh( geometry, material );
scene.add( object );
},
// onProgress callback
function ( xhr ) {
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
// onError callback
function( err ) {
console.log( 'An error happened' );
}
);
</code>
<h2>Constructor</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
</p>
<p>
Creates a new [name].
</p>
<h2>Properties</h2>
<h3>[property:String crossOrigin]</h3>
<p>
If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
attribute of the image to the value of *crossOrigin*, prior to starting the load. Default is *"anonymous"*.
</p>
<h3>[property:LoadingManager manager]</h3>
<p>
The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
</p>
<h3>[property:String withCredentials]</h3>
<p>
Whether the XMLHttpRequest uses credentials.
Default is *false*.
</p>
<h2>Methods</h2>
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
<p>
[page:String url] — the path or URL to the file. This can also be a
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI]..<br />
[page:Function onLoad] — Will be called when load completes. The argument will be the loaded text response.<br />
[page:Function onProgress] — Will be called while load progresses. The argument will be the XMLHttpRequest instance, which contains .[page:Integer total] and .[page:Integer loaded] bytes.<br />
[page:Function onError] — Will be called when load errors.<br />
</p>
<p>
Begin loading from url and pass the <em>JSON</em> to onLoad.
</p>
<h3>[method:Object3D parse]( [param:Object json], [param:String path] )</h3>
<p>
[page:String json] — JSON object to parse.<br />
[page:String path] — Base path for resources if no resource path is defined.<br /><br />
Parse a <em>JSON</em> structure and return an [page:object] containing the parsed [page:Geometry geometry] and [page:Array materials].
</p>
<h3>[method:JSONLoader setCrossOrigin]( [param:String value] )</h3>
<p>
Set the [page:.crossOrigin] attribute.
</p>
<h3>[method:JSONLoader setPath]( [param:String value] )</h3>
<p>
Set the base path for the original file.
</p>
<h3>[method:JSONLoader setResourcePath]( [param:String value] )</h3>
<p>
Set the base path for dependent resources like textures.
</p>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
......@@ -11,10 +11,7 @@
<h1>[name]</h1>
<p class="desc">
A loader for loading a JSON resource. Unlike the [page:JSONLoader], this one make use of the
<em>.type</em> attributes of objects to map them to their original classes.<br /><br />
Note that this loader can't load [page:Geometries]. Use [page:JSONLoader] instead for that.<br /><br />
A loader for loading a JSON resource in the [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].<br /><br />
This uses the [page:FileLoader] internally for loading files.
</p>
......@@ -22,10 +19,8 @@
<h2>Example</h2>
<p>
[example:webgl_animation_scene WebGL / animation / scene]<br />
[example:webgl_loader_json_claraio WebGL / loader / json / claraio]<br />
[example:webgl_loader_msgpack WebGL / loader / msgpack]
[example:webgl_materials_lightmap WebGL / materials / lightmap]
</p>
<code>
......@@ -121,7 +116,6 @@
[page:Object json] — required. The JSON source to parse.<br /><br />
This is used [page:.parse] to parse any [page:Geometry geometries] or [page:BufferGeometry buffer geometries] in the JSON structure.
Internally it uses [page:JSONLoader] for geometries and [page:BufferGeometryLoader] for buffer geometries.
</p>
<h3>[method:Object3D parseMaterials]( [param:Object json] )</h3>
......
......@@ -444,7 +444,7 @@ this.extensions = {
<h3>[property:Float wireframeLinewidth]</h3>
<p>Controls wireframe thickness. Default is 1.<br /><br />
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile)
Due to limitations of the [link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile]
with the [page:WebGLRenderer WebGL] renderer on most platforms linewidth will
always be 1 regardless of the set value.
</p>
......
......@@ -17,8 +17,6 @@
<h2>Examples</h2>
<div>
[example:webgl_sprites WebGL / sprites]<br />
[example:misc_ubiquity_test misc / ubiquity / test]<br />
[example:misc_ubiquity_test2 misc / ubiquity / test2]<br />
[example:software_sandbox software / sandbox]<br />
[example:svg_sandbox svg / sandbox]<br />
[example:webgl_materials_cubemap_dynamic webgl / materials / cubemap / dynamic]
......
......@@ -38,41 +38,60 @@
<h2>Example</h2>
<code>
var geometry = new THREE.CylinderGeometry( 5, 5, 5, 5, 15, 5, 30 );
var geometry = new THREE.CylinderBufferGeometry( 5, 5, 5, 5, 15, 5, 30 );
//Create the skin indices and skin weights
for ( var i = 0; i < geometry.vertices.length; i ++ ) {
// create the skin indices and skin weights
// Imaginary functions to calculate the indices and weights
// This part will need to be changed depending your skeleton and model
var skinIndex = calculateSkinIndex( geometry.vertices, i );
var skinWeight = calculateSkinWeight( geometry.vertices, i );
var position = geometry.attributes.position;
// Ease between each bone
geometry.skinIndices.push( new THREE.Vector4( skinIndex, skinIndex + 1, 0, 0 ) );
geometry.skinWeights.push( new THREE.Vector4( 1 - skinWeight, skinWeight, 0, 0 ) );
var vertex = new THREE.Vector3();
var skinIndices = [];
var skinWeights = [];
for ( var i = 0; i < position.count; i ++ ) {
vertex.fromBufferAttribute( position, i );
// compute skinIndex and skinWeight based on some configuration data
var y = ( vertex.y + sizing.halfHeight );
var skinIndex = Math.floor( y / sizing.segmentHeight );
var skinWeight = ( y % sizing.segmentHeight ) / sizing.segmentHeight;
skinIndices.push( skinIndex, skinIndex + 1, 0, 0 );
skinWeights.push( 1 - skinWeight, skinWeight, 0, 0 );
}
geometry.addAttribute( 'skinIndex', new THREE.Uint16BufferAttribute( skinIndices, 4 ) );
geometry.addAttribute( 'skinWeight', new THREE.Float32BufferAttribute( skinWeights, 4 ) );
// create skinned mesh and skeleton
var mesh = new THREE.SkinnedMesh( geometry, material );
var skeleton = new THREE.Skeleton( bones );
// see example from THREE.Skeleton
// See example from THREE.Skeleton for the armSkeleton
var rootBone = armSkeleton.bones[ 0 ];
var rootBone = skeleton.bones[ 0 ];
mesh.add( rootBone );
// Bind the skeleton to the mesh
mesh.bind( armSkeleton );
// bind the skeleton to the mesh
mesh.bind( skeleton );
// move the bones and manipulate the model
// Move the bones and manipulate the model
armSkeleton.bones[ 0 ].rotation.x = -0.1;
armSkeleton.bones[ 1 ].rotation.x = 0.2;
skeleton.bones[ 0 ].rotation.x = -0.1;
skeleton.bones[ 1 ].rotation.x = 0.2;
</code>
<h2>Constructor</h2>
<h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
<h3>[name]( [param:BufferGeometry geometry], [param:Material material] )</h3>
<p>
[page:Geometry geometry] - an instance of [page:Geometry] or [page:BufferGeometry] (recommended).
[page:Geometry.skinIndices skinIndices] and [page:Geometry.skinWeights skinWeights] should be set to true on the geometry.<br />
[page:Geometry geometry] - an instance of [page:BufferGeometry].<br />
[page:Material material] - (optional) an instance of [page:Material]. Default is a new [page:MeshBasicMaterial].
</p>
......@@ -109,8 +128,7 @@
<h3>[property:Skeleton skeleton]</h3>
<p>
[page:Skeleton] created from the [page:Geometry.bones bones] of the [page:Geometry] passed in the
constructor.
[page:Skeleton] representing the bone hierachy of the skinned mesh.
</p>
......@@ -124,9 +142,7 @@
[page:Matrix4 bindMatrix] - [page:Matrix4] that represents the base transform of the skeleton.<br /><br />
Bind a skeleton to the skinned mesh. The bindMatrix gets saved to .bindMatrix property
and the .bindMatrixInverse gets calculated. This is called automatically in the constructor, and the skeleton
is created from the [page:Geometry.bones bones] of the [page:Geometry] passed in the
constructor.
and the .bindMatrixInverse gets calculated.
</p>
<h3>[method:SkinnedMesh clone]()</h3>
......@@ -136,7 +152,7 @@
<h3>[method:null normalizeSkinWeights]()</h3>
<p>
Normalizes the [page:Geometry.skinWeights] vectors. Does not affect [page:BufferGeometry].
Normalizes the skin weights.
</p>
<h3>[method:null pose]()</h3>
......@@ -149,11 +165,6 @@
Updates the [page:Matrix4 MatrixWorld].
</p>
<h3>[method:null initBones]()</h3>
<p>
Creates an array of hierarchical [page:Bone bones] objects from the internal geometry.
</p>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -41,7 +41,7 @@
<h3>[property:Object background]</h3>
<p>
If not null, sets the background used when rendering the scene, and is always rendered first. Can be set to a [page:Color] which sets the clear color, a [page:Texture] covering the canvas, or a [page:CubeTexture]. Default is null.
If not null, sets the background used when rendering the scene, and is always rendered first. Can be set to a [page:Color] which sets the clear color, a [page:Texture] covering the canvas, or a cubemap as a [page:CubeTexture] or [page:WebGLRenderTargetCube]. Default is null.
</p>
<h2>Methods</h2>
......
......@@ -91,10 +91,7 @@
<h3>[method:Array CreateClipsFromMorphTargetSequences]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3>
<p>
返回从几何体的变形目标序列([page:Geometry.morphTargets morph
target sequences])创建的新动画剪辑(AnimationClip)数组,并尝试将变形目标名称分类为基于动画组的模式,如“Walk_001、Walk_002、Run_001、Run_002……”。<br /><br />
该方法被[page:JSONLoader]内部调用, 并且它使用了
[page:.CreateFromMorphTargetSequence CreateFromMorphTargetSequence].
target sequences])创建的新动画剪辑(AnimationClip)数组,并尝试将变形目标名称分类为基于动画组的模式,如“Walk_001、Walk_002、Run_001、Run_002……”。
</p>
<h3>[method:AnimationClip CreateFromMorphTargetSequence]( [param:String name], [param:Array morphTargetSequence], [param:Number fps], [param:Boolean noLoop] )</h3>
......
......@@ -14,36 +14,36 @@
<h1>[name]</h1>
<p class="desc">
A Track of boolean keyframe values.
布尔类型的关键帧轨道。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
[page:String name] - (必须) 关键帧轨道(KeyframeTrack)的标识符.<br />
[page:Array times] - (必须) 关键帧的时间数组.<br />
[page:Array values] - 与时间数组中的时间点对应的值数组.<br />
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
参见 [page:KeyframeTrack] 查看继承的属性.
</p>
<h3>[property:Constant DefaultInterpolation]</h3>
<p>
The default interpolation type to use, [page:Animation InterpolateDiscrete].
默认的插值类型。 参见 [page:Animation InterpolateDiscrete].
</p>
<h3>[property:Array ValueBufferType]</h3>
<p>
A normal Array (no Float32Array in this case, unlike *ValueBufferType* of [page:KeyframeTrack]).
一个基本数组 (不是 Float32Array 类型, 与 [page:KeyframeTrack] 内的 *ValueBufferType* 属性不一样).
</p>
<h3>[property:String ValueTypeName]</h3>
......@@ -52,25 +52,25 @@
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
参见 [page:KeyframeTrack] 查看继承的方法.
</p>
<h3>[method:null InterpolantFactoryMethodLinear ]()</h3>
<p>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
这个方法在这里的值为 'undefined', 因为他对离散属性没有意义.
</p>
<h3>[method:null InterpolantFactoryMethodSmooth ]()</h3>
<p>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
这个方法在这里的值为 'undefined', 因为他对离散属性没有意义.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -14,31 +14,30 @@
<h1>[name]</h1>
<p class="desc">
A Track of keyframe values that represent color changes.<br /><br />
The very basic implementation of this subclass has nothing special yet. However, this is the place
for color space parameterization.
反应颜色变化的关键帧轨道。<br /><br />
这个子类的基本实现还没有什么特别之处。不过,这里可以表示颜色空间参数化。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
[page:Constant interpolation] - the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:String name] - (必须) 关键帧轨道(KeyframeTrack)的标识符.<br />
[page:Array times] - (必须) 关键帧的时间数组.<br />
[page:Array values] - 与时间数组中的时间点对应的值数组.<br />
[page:Constant interpolation] - 使用的插值类型。 取值参考
[page:Animation Animation Constants]. 默认值为
[page:Animation InterpolateLinear].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
参见 [page:KeyframeTrack] 查看继承的属性.
</p>
<h3>[property:String ValueTypeName]</h3>
......@@ -51,10 +50,10 @@
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
参见 [page:KeyframeTrack] 查看继承的方法.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -14,29 +14,29 @@
<h1>[name]</h1>
<p class="desc">
A Track of numeric keyframe values.
数字类型的关键帧轨道
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
[page:Constant interpolation] - the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:String name] - (必须) 关键帧轨道(KeyframeTrack)的标识符.<br />
[page:Array times] - (必须) 关键帧的时间数组.<br />
[page:Array values] - 与时间数组中的时间点对应的值数组.<br />
[page:Constant interpolation] - 使用的插值类型。 取值参考
[page:Animation Animation Constants] 默认值为
[page:Animation InterpolateLinear].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
参见 [page:KeyframeTrack] 查看继承的属性.
</p>
......@@ -46,15 +46,15 @@
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
参见 [page:KeyframeTrack] 查看继承的方法.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -14,34 +14,34 @@
<h1>[name]</h1>
<p class="desc">
A Track of quaternion keyframe values.
四元数类型的关键帧轨道。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<p>
[page:String name] (required) identifier for the KeyframeTrack.<br />
[page:Array times] (required) array of keyframe times.<br />
[page:Array values] values for the keyframes at the times specified.<br />
[page:Constant interpolation] the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:String name] - (必须) 关键帧轨道(KeyframeTrack)的标识符.<br />
[page:Array times] - (必须) 关键帧的时间数组.<br />
[page:Array values] - 与时间数组中的时间点对应的值数组.<br />
[page:Constant interpolation] - 使用的插值类型。 取值参考
[page:Animation Animation Constants] 默认值为
[page:Animation InterpolateLinear].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
参见 [page:KeyframeTrack] 查看继承的属性.
</p>
<h3>[property:Constant DefaultInterpolation]</h3>
<p>
The default interpolation type to use, [page:Animation InterpolateLinear].
默认的插值类型。 参见 [page:Animation InterpolateDiscrete].
</p>
<h3>[property:String ValueTypeName]</h3>
......@@ -50,22 +50,23 @@
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
参见 [page:KeyframeTrack] 查看继承的方法.
</p>
<h3>[method:null InterpolantFactoryMethodLinear]()</h3>
<p>
Returns a new [page:QuaternionLinearInterpolant QuaternionLinearInterpolant] based on the
[page:KeyframeTrack.values values], [page:KeyframeTrack.times times] and
[page:KeyframeTrack.valueSize valueSize] of the keyframes.
根据值数组 ([page:KeyframeTrack.values values]),
时间 ([page:KeyframeTrack.times times])
和值大小 [page:KeyframeTrack.valueSize valueSize]
创建一个新的线性插值 ([page:QuaternionLinearInterpolant QuaternionLinearInterpolant])。
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -14,39 +14,39 @@
<h1>[name]</h1>
<p class="desc">
A Track of string keyframe values.
字符串类型的关键帧轨道
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
[page:Constant interpolation] - the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:String name] - (必须) 关键帧轨道(KeyframeTrack)的标识符.<br />
[page:Array times] - (必须) 关键帧的时间数组.<br />
[page:Array values] - 与时间数组中的时间点对应的值数组.<br />
[page:Constant interpolation] - 使用的插值类型。 取值参考
[page:Animation Animation Constants] 默认值为
[page:Animation InterpolateDiscrete].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
参见 [page:KeyframeTrack] 查看继承的属性.
</p>
<h3>[property:Constant DefaultInterpolation]</h3>
<p>
The default interpolation type to use, [page:Animation InterpolateDiscrete].
默认的插值类型。 参见 [page:Animation InterpolateDiscrete].
</p>
<h3>[property:Array ValueBufferType]</h3>
<p>
A normal Array (no Float32Array in this case, unlike *ValueBufferType* of [page:KeyframeTrack]).
一个基本数组 (不是 Float32Array 类型, 与 [page:KeyframeTrack] 内的 *ValueBufferType* 属性不一样).
</p>
<h3>[property:String ValueTypeName]</h3>
......@@ -55,25 +55,25 @@
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
参见 [page:KeyframeTrack] 查看继承的方法.
</p>
<h3>[method:null InterpolantFactoryMethodLinear]()</h3>
<p>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
这个方法在这里的值为 'undefined', 因为他对离散属性没有意义.
</p>
<h3>[method:null InterpolantFactoryMethodSmooth]()</h3>
<p>
The value of this method here is 'undefined', as it does not make sense for discrete properties.
这个方法在这里的值为 'undefined', 因为他对离散属性没有意义.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -14,29 +14,29 @@
<h1>[name]</h1>
<p class="desc">
A Track of vector keyframe values.
向量类型的关键帧轨道
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:String name], [param:Array times], [param:Array values] )</h3>
<p>
[page:String name] - (required) identifier for the KeyframeTrack.<br />
[page:Array times] - (required) array of keyframe times.<br />
[page:Array values] - values for the keyframes at the times specified.<br />
[page:Constant interpolation] - the type of interpolation to use. See
[page:Animation Animation Constants] for possible values. Default is
[page:String name] - (必须) 关键帧轨道(KeyframeTrack)的标识符.<br />
[page:Array times] - (必须) 关键帧的时间数组.<br />
[page:Array values] - 与时间数组中的时间点对应的值数组.<br />
[page:Constant interpolation] - 使用的插值类型。 取值参考
[page:Animation Animation Constants] 默认值为
[page:Animation InterpolateLinear].
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited properties.
参见 [page:KeyframeTrack] 查看继承的属性.
</p>
<h3>[property:String ValueTypeName]</h3>
......@@ -45,15 +45,15 @@
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p class="desc">
See [page:KeyframeTrack] for inherited methods.
参见 [page:KeyframeTrack] 查看继承的方法.
</p>
<h2>Source</h2>
<h2>源码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
......
......@@ -62,6 +62,9 @@
<h3>[property:AudioContext context]</h3>
<p>构造函数中传入[page:AudioListener listener]的[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioContext AudioContext].</p>
<h3>[property:Number detune]</h3>
<p>TODO</p>
<h3>[property:Array filters]</h3>
<p>表示[link:https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode BiquadFilterNodes]的数组. 可以使用多种不同的低阶filters去创建复杂的音效. filters可以通过 [page:Audio.setFilter] 或者 [page:Audio.setFilters]设置.</p>
......@@ -78,6 +81,9 @@
<h3>[property:Boolean isPlaying]</h3>
<p>是否正在播放</p>
<h3>[property:AudioListener listener]</h3>
<p>A reference to the listener object of this audio.</p>
<h3>[property:Number startTime]</h3>
<p>开始播放的时间. 和[link:https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/start AudioBufferSourceNode.start]()的*when*参数一样. 默认为 *0*.</p>
......
......@@ -66,6 +66,8 @@
<h3>[property:AudioNode filter]</h3>
<p>默认为*null*.</p>
<h3>[property:Number timeDelta]</h3>
<p>Time delta value for audio entities. Use in context of [link:https://developer.mozilla.org/en-US/docs/Web/API/AudioParam/linearRampToValueAtTime AudioParam.linearRampToValueAtTimeDefault](). Default is *0*.</p>
<h2>方法</h2>
......
......@@ -10,19 +10,19 @@
<body>
[page:PerspectiveCamera] &rarr;
<h1>阵列摄像机([name])</h1>
<h1>摄像机阵列([name])</h1>
<p class="desc">
[name] 可以被用来更加高效地用一组已经预定义好的摄像机来渲染一个场景。 这对于VR场景的渲染来说,是非常重要的一个性能体现<br />
一个 [name] 的实例中总是包含着一组子摄像机,应当为每一个子摄像机定义*bound*(边界)这个属性,属性决定了由该子摄像机所渲染的视口区域的大小。
[name] 用于更加高效地使用一组已经预定义的摄像机来渲染一个场景。这将能够更好地提升VR场景的渲染性能<br />
一个 [name] 的实例中总是包含着一组子摄像机,应当为每一个子摄像机定义*bound*(边界)这个属性,这一属性决定了由该子摄像机所渲染的视口区域的大小。
</p>
<h2>示例</h2>
<p>[example:webgl_camera_array camera / array ]</p>
<h2>构造</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Array array] )</h3>
<p>
......@@ -35,7 +35,7 @@
<h3>[property:Array cameras]</h3>
<p>
摄像机组。
摄像机组。
</p>
<h2>方法</h2>
......
......@@ -191,7 +191,7 @@
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -78,7 +78,7 @@
</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -96,7 +96,7 @@
<p>传入一个需要转换的 [page:Geometry] 实例。</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -93,7 +93,7 @@ car.start();
</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -18,7 +18,6 @@
<h2>示例</h2>
<p>[example:misc_ubiquity_test ubiquity / test ]</p>
<p>[example:svg_sandbox svg / sandbox ]</p>
<p>[example:misc_exporter_obj exporter / obj ]</p>
<p>[example:webgl_shaders_vector WebGL / shaders / vector ]</p>
......@@ -123,7 +122,7 @@ scene.add( new THREE.Mesh( geometry, material ) );
<p>将参数指定的 Face3 对象的数据拷贝到当前对象。</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -327,7 +327,7 @@
</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -37,7 +37,7 @@
<h2>方法</h2>
<p>继承方法详见 [page:BufferAttribute]。</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -43,7 +43,7 @@
</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -41,7 +41,7 @@
继承方法详见 [page:InterleavedBuffer]。
</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -112,7 +112,7 @@
克隆当前 [name]。
</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -94,7 +94,7 @@
<h3>[method:null setXYZW]( [param:Integer index], [param:Float x], [param:Float y], [param:Float z], [param:Float w] ) </h3>
<p>通过给定参数,设置指定索引矢量的第一、二、三、四个元素 (X Y Z 和 W 值)。</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -75,7 +75,7 @@
根据参数切换对象所属图层。
</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -206,7 +206,7 @@
该方法的使用示例详见 [example:webgldeferred_animation WebGL deferred animation]。
</p>
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -31,14 +31,14 @@
<h2>构造函数</h2>
All of the above are called in the same way.
所有上述内容都以相同的方式调用。
<h3>TypedBufferAttribute( [param:Array array], [param:Integer itemSize], [param:Boolean normalized] )</h3>
<p>
array -- this can be a typed or untyped (normal) array. It will be converted to the Type specified.<br /><br />
array -- 这可以是类型化或非类型化的(普通)数组。它将被转换为指定的类型。<br /><br />
itemSize -- the number of values of the array that should be associated with a particular vertex.<br /><br />
itemSize -- 应与特定顶点关联的数组值的数量。<br /><br />
normalized -- (optional) indicates how the underlying data in the buffer maps to the values in the GLSL code.
normalized -- (可选)表示缓冲区中的基础数据如何映射到GLSL代码中的值。
</p>
<h2>属性</h2>
......@@ -49,7 +49,7 @@
继承方法详见 [page:BufferAttribute]。
<h2>资源</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/core/BufferAttribute.js src/core/BufferAttribute.js]
</body>
......
......@@ -15,10 +15,6 @@
下面就列举出了这些API元素,以及一些关于他们的替代信息。
</p>
<h2>音频(Audio)</h2>
<h3>[page:Audio]</h3>
......@@ -31,9 +27,6 @@
<p>BinaryTextureLoader 已被重命名为 [page:DataTextureLoader]。</p>
<h2>缓冲器(Buffers)</h2>
<h3>[page:BufferAttribute]</h3>
......@@ -232,24 +225,13 @@
Light.shadowMapHeight 现在是 [page:Light.shadow.mapSize.height]。
</p>
<h2>加载器(Loaders)</h2>
<h3>[page:XHRLoader]</h3>
<p>XHRLoader 已被重命名为 [page:FileLoader]。</p>
<h3>[page:JSONLoader]</h3>
<p>JSONLoader has been removed from core.</p>
<h2>数学(Maths)</h2>
......@@ -481,11 +463,10 @@
Shape.makeGeometry 已被删除。 请使用[page:ShapeGeometry] 。
</p>
<h3>[page:SkinnedMesh]</h3>
<p>
SkinnedMesh.initBones() has been removed.
</p>
<h2>渲染器(Renderer)</h2>
......
......@@ -11,20 +11,20 @@
<h1>[name]</h1>
<p class="desc">
An implementation of the earcut polygon triangulation algorithm. The code is a port of [link:https://github.com/mapbox/earcut mapbox/earcut].
切割多边形三角剖分算法的实现。这份代码是[link:https://github.com/mapbox/earcut mapbox/earcut]的一个端口。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:Array triangulate]( data, holeIndices, dim )</h3>
<p>
data -- A flat array of vertice coordinates.<br /><br />
holeIndices -- An array of hole indices if any.<br /><br />
dim -- The number of coordinates per vertice in the input array.<br /><br />
data -- 一个顶点坐标的平面数组。<br /><br />
holeIndices -- 空洞索引的数组(如果有的话)。<br /><br />
dim -- 输入数组中每个顶点的坐标数。<br /><br />
</p>
<h2>Source</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,43 +11,40 @@
<h1>[name]</h1>
<p class="desc">
A class containing utility functions for shapes.<br /><br />
一个包含形状实用函数的类。<br /><br />
Note that these are all linear functions so it is neccessary to calculate separately for
x, y (and z, w if present) components of a vector.
请注意,这些都是线性函数,因此有必要分别计算向量的x,y(和z,w,如果存在的话)分量。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[method:Number area]( contour )</h3>
<p>
contour -- 2D polygon.<br /><br />
contour -- 2D多边形。<br /><br />
Calculate area of a ( 2D ) contour polygon.<br /><br />
计算(2D)轮廓多边形的面积。<br /><br />
</p>
<h3>[method:Boolean isClockwise]( pts )</h3>
<p>
pts -- points defining a 2D polygon<br /><br />
pts -- 定义2D多边形的点<br /><br />
Note that this is a linear function so it is neccessary to calculate separately for
x, y components of a polygon.<br /><br />
请注意,这是一个线性函数,因此需要分别计算多边形的x,y分量。<br /><br />
Used internally by [page:Path Path],
[page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeGeometry ShapeGeometry].
由[page:Path Path],[page:ExtrudeGeometry ExtrudeGeometry]和[page:ShapeGeometry ShapeGeometry]内部使用。
</p>
<h3>[method:Array triangulateShape]( contour, holes )</h3>
<p>
contour -- 2D polygon.<br />
holes -- array of holes<br /><br />
contour -- 2D多边形。<br />
holes -- 空洞数组<br /><br />
Used internally by [page:ExtrudeGeometry ExtrudeGeometry] and [page:ShapeGeometry ShapeGeometry] to calculate faces in shapes with holes.
由[page:ExtrudeGeometry ExtrudeGeometry]和[page:ShapeGeometry ShapeGeometry]内部使用以计算带孔的形状中的面。
</p>
<h2>Source</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -13,7 +13,7 @@
<h1>多面几何体([name])</h1>
<p class="desc">
多面体在三维空间中具有一些平面的立体图形。这个类将一个顶点数组投射到一个球面上,之后将它们细分为所需的细节级别。
多面体在三维空间中具有一些平面的立体图形。这个类将一个顶点数组投射到一个球面上,之后将它们细分为所需的细节级别。
</p>
<h2>示例</h2>
......
......@@ -38,7 +38,6 @@
<p>
[example:canvas_morphtargets_horse morphtargets / horse ]<br />
[example:misc_controls_fly controls / fly ]<br />
[example:misc_lights_test lights / test ]<br />
[example:webvr_cubes cubes ]<br />
[example:webgl_effects_parallaxbarrier effects / parallaxbarrier ]<br />
[example:webgl_effects_stereo effects / stereo ]<br />
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<p class="desc">
以JSON格式来加载对象的加载器。
此加载器内部用 [page:FileLoader] 来加载文件。
</p>
<h2>例子</h2>
<p>
[example:webgl_loader_json WebGL / loader / json]<br />
[example:webgl_loader_json_objconverter WebGL / loader / json / objconverter]
</p>
<code>
// 初始化一个加载器
var loader = new THREE.JSONLoader();
// 加载一个资源
loader.load(
// 资源URL
'models/animated/monster/monster.js',
// onLoad的回调
function ( geometry, materials ) {
var material = materials[ 0 ];
var object = new THREE.Mesh( geometry, material );
scene.add( object );
},
// onProgress的回调
function ( xhr ) {
console.log( (xhr.loaded / xhr.total * 100) + '% loaded' );
},
// onError的回调
function( err ) {
console.log( 'An error happened' );
}
);
</code>
<h2>构造函数</h2>
<h3>[name]( [param:LoadingManager manager] )</h3>
<p>
[page:LoadingManager manager] — 加载器所使用的 [page:LoadingManager loadingManager]。 默认为 [page:LoadingManager THREE.DefaultLoadingManager].
</p>
<p>
创建一个新的 [name].
</p>
<h2>属性</h2>
<h3>[property:String crossOrigin]</h3>
<p>
如果设置了,在开始加载前, 将为图片分配 [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
属性,其值为 *crossOrigin*,默认为"anonymous"。
</p>
<h3>[property:LoadingManager manager]</h3>
<p>
加载器正在使用的 [page:LoadingManager loadingManager] 。 默认为 [page:DefaultLoadingManager].
</p>
<h3>[property:String withCredentials]</h3>
<p>
XMLHttpRequest请求是否使用了证书。
默认为 *false*.
</p>
<h2>方法</h2>
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
<p>
[page:String url] — 文件的URL或者路径,也可以为
[link:https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs Data URI]..<br />
[page:Function onLoad] — 加载完成时将调用。回调参数将是加载的响应。<br />
[page:Function onProgress] — 将在加载过程中进行调用。参数为XMLHttpRequest实例,
其中包含 [page:Integer total] 和 [page:Integer loaded] 字节。<br />
[page:Function onError] — 在加载错误时被调用。<br />
</p>
<p>
从URL中进行加载并将 <em>JSON</em> 传递给 onLoad。
</p>
<h3>[method:JSONLoader setCrossOrigin]( [param:String value] )</h3>
<p>
设置 [page:.crossOrigin] 的属性。
</p>
<h3>[method:JSONLoader setTexturePath]( [param:String texturePath] )</h3>
<p>
设置加载文件的基本路径或URL。当加载同一目录中的许多模型,此方法将很有用。
</p>
<h3>[method:Object3D parse]( [param:Object json], [param:String texturePath] )</h3>
<p>
[page:String json] — 需要解析的JSON对象。<br />
[page:String texturePath] — 纹理的基本路径。<br /><br />
解析要给 <em>JSON</em> 结构并返回 [page:object] 包含 [page:Geometry geometry] 和 [page:Array materials] 的对象.
</p>
<h2></h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
......@@ -11,10 +11,7 @@
<h1>[name]</h1>
<p class="desc">
一个用来加载JSON资源的加载器。 不像[page:JSONLoader],这个加载器使用
<em>.type</em>对象属性,来映射它自己到源类。<br /><br />
请注意这个加载器不能用来加载[page:Geometries],而是用[page:JSONLoader]进行加载。<br /><br />
A loader for loading a JSON resource in the [link:https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 JSON Object/Scene format].<br /><br />
此加载器内部使用[page:FileLoader]进行加载文件。
</p>
......@@ -22,10 +19,8 @@
<h2>例子</h2>
<p>
[example:webgl_animation_scene WebGL / animation / scene]<br />
[example:webgl_loader_json_claraio WebGL / loader / json / claraio]<br />
[example:webgl_loader_msgpack WebGL / loader / msgpack]
[example:webgl_materials_lightmap WebGL / materials / lightmap]
</p>
<code>
......@@ -120,7 +115,6 @@
[page:Object json] — 必选参数,需要被解析的JSON源。<br /><br />
此函数以JSON结构,用[page:.parse]去解析[page:Geometry geometries]或[page:BufferGeometry buffer geometries]。
在内部,它使用JSONLoader作为几何加载器,使用BufferGeometryLoader作为几何缓冲区加载器。
</p>
<h3>[method:Object3D parseMaterials]( [param:Object json] )</h3>
......
......@@ -17,8 +17,6 @@
<h2>例子(Examples)</h2>
<div>
[example:webgl_sprites WebGL / sprites]<br />
[example:misc_ubiquity_test misc / ubiquity / test]<br />
[example:misc_ubiquity_test2 misc / ubiquity / test2]<br />
[example:software_sandbox software / sandbox]<br />
[example:svg_sandbox svg / sandbox]<br />
[example:webgl_materials_cubemap_dynamic webgl / materials / cubemap / dynamic]
......
......@@ -11,291 +11,278 @@
<h1>[name]</h1>
<p class="desc">
Represents a box or cube in 3D space. The main purpose of this is to represent
the [link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Boxes]
for objects.
在3D空间中表示一个盒子或立方体。这个的主要目的是表示对象的最小边界框[link:https://en.wikipedia.org/wiki/Minimum_bounding_box Minimum Bounding Boxes]。
</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Vector3 min], [param:Vector3 max] )</h3>
<p>
[page:Vector3 min] - (optional) [page:Vector3] representing the lower (x, y, z) boundary of the box.
Default is ( + Infinity, + Infinity, + Infinity ).<br>
[page:Vector3 min] - (参数可选) [page:Vector3] 表示包围盒的下边界。
默认值是( + Infinity, + Infinity, + Infinity )。<br>
[page:Vector3 max] - (optional) [page:Vector3] representing the lower upper (x, y, z) boundary of the box.
Default is ( - Infinity, - Infinity, - Infinity ).<br /><br />
[page:Vector3 max] - (参数可选) [page:Vector3] 表示包围盒的上边界。
默认值是( - Infinity, - Infinity, - Infinity )。<br /><br />
Creates a [name] bounded by min and max.
创建一个以max和min为边界的包围盒。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Boolean isBox3]</h3>
<p>
Used to check whether this or derived classes are Box3s. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
用于检测当前对象或者派生类对象是否是Box3。默认为 *true*。<br /><br />
不应该修改这个值,因为内部使用该属性做了优化的任务。
</p>
<h3>[property:Vector3 min]</h3>
<p>
[page:Vector3] representing the lower (x, y, z) boundary of the box.<br />
Default is ( + Infinity, + Infinity, + Infinity ).
[page:Vector3] 表示包围盒的下边界。<br />
默认值是( - Infinity, - Infinity, - Infinity )。
</p>
<h3>[property:Vector3 max]</h3>
<p>
[page:Vector3] representing the upper (x, y, z) boundary of the box.<br />
Default is ( - Infinity, - Infinity, - Infinity ).
[page:Vector3] 包围盒的(x, y, z)上边界。<br />
默认值是 ( - Infinity, - Infinity, - Infinity ).
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Box3 applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p>
[page:Matrix4 matrix] - The [page:Matrix4] to apply<br /><br />
Transforms this Box3 with the supplied matrix.
[page:Matrix4 matrix] - 要应用的 [page:Matrix4] <br /><br />
使用传入的矩阵变换Box3(包围盒8个顶点都会乘以这个变换矩阵)。
</p>
<h3>[method:Vector3 clampPoint]( [param:Vector3 point], [param:Vector3 target] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] to clamp. <br>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 point] - 需要做clamp 的坐标 [page:Vector3]。 <br>
[page:Vector3 target] — 结果将会被拷贝到这个对象中<br /><br />
[link:https://en.wikipedia.org/wiki/Clamping_(graphics) Clamps] the [page:Vector3 point] within the bounds of this box.<br />
是这个点[page:Vector3 point] [link:https://en.wikipedia.org/wiki/Clamping_(graphics) Clamps](处于范围内) 处于包围盒边界范围内。<br />
</p>
<h3>[method:Box3 clone]()</h3>
<p>Returns a new [page:Box3] with the same [page:.min min] and [page:.max max] as this one.</p>
<p>返回一个与该包围盒子有相同下边界[page:.min min] 和上边界 [page:.max max]的新包围盒。</p>
<h3>[method:Boolean containsBox]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - [page:Box3 Box3] to test for inclusion.<br /><br />
Returns true if this box includes the entirety of [page:Box3 box]. If this and [page:Box3 box] are identical, <br>
this function also returns true.
[page:Box3 box] - 需要检测是否在当前包围盒内的 [page:Box3 Box3]。<br /><br />
传入的 [page:Box3 box] 整体都被包含在该对象中则返回true。如果他们两个包围盒是一样的也返回true。
</p>
<h3>[method:Boolean containsPoint]( [param:Vector3 point] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] to check for inclusion.<br /><br />
[page:Vector3 point] - 需要检测是否在当前包围盒内的 [page:Vector3]。<br /><br />
Returns true if the specified [page:Vector3 point] lies within or on the boundaries of this box.
当传入的值 [page:Vector3 point] 在包围盒内部或者边界都会返回true。
</p>
<h3>[method:Box3 copy]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - [page:Box3] to copy.<br /><br />
[page:Box3 box] - 需要复制的包围盒 [page:Box3] 。<br /><br />
Copies the [page:.min min] and [page:.max max] from [page:Box3 box] to this box.
将传入的值 [page:Box3 box] 中的 [page:.min min] 和 [page:.max max] 拷贝到当前对象。
</p>
<h3>[method:Float distanceToPoint]( [param:Vector3 point] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] to measure distance to.<br /><br />
[page:Vector3 point] - 用来测试距离的点 [page:Vector3]。<br /><br />
Returns the distance from any edge of this box to the specified point.
If the [page:Vector3 point] lies inside of this box, the distance will be 0.
返回这个box的任何边缘到指定点的距离。如果这个点位于这个盒子里,距离将是0。
</p>
<h3>[method:Boolean equals]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - Box to compare with this one.<br /><br />
[page:Box3 box] - 将box与当前对象做比较。<br /><br />
Returns true if this box and [page:Box3 box] share the same lower and upper bounds.
返回true如果传入的值与当前的对象 [page:Box3 box] 有相同的上下边界。
</p>
<h3>[method:Box3 expandByObject]( [param:Object3D object] )</h3>
<p>
[page:Object3D object] - [page:Object3D] to expand the box by.<br /><br />
[page:Object3D object] - 包裹在包围盒中的3d对象 [page:Object3D]。<br /><br />
Expands the boundaries of this box to include [page:Object3D object] and its children,
accounting for the object's, and children's, world transforms.
扩展此包围盒的边界,使得对象及其子对象在包围盒内,包括对象和子对象的世界坐标的变换。
</p>
<h3>[method:Box3 expandByPoint]( [param:Vector3 point] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] that should be included in the box.<br /><br />
[page:Vector3 point] - 需要在包围盒中的点 [page:Vector3]。<br /><br />
Expands the boundaries of this box to include [page:Vector3 point].
扩展这个包围盒的边界使得该点([page:Vector3 point])在包围盒内。
</p>
<h3>[method:Box3 expandByScalar]( [param:float scalar] )</h3>
<p>
[page:float scalar] - Distance to expand the box by.<br /><br />
[page:float scalar] - 扩展包围盒的比例。<br /><br />
Expands each dimension of the box by [page:float scalar]. If negative, the dimensions of the box
will be contracted.
按 [page:float scalar] 的值展开盒子的每个维度。如果是负数,盒子的尺寸会缩小。
</p>
<h3>[method:Box3 expandByVector]( [param:Vector3 vector] )</h3>
<p>
[page:Vector3 vector] - [page:Vector3] to expand the box by.<br /><br />
[page:Vector3 vector] - 扩展包围盒的数值 [page:Vector3] 。<br /><br />
按 [page:Vector3 vector] 每个纬度的值展开这个箱子。
这个盒子的宽度将由 [page:Vector3 vector] 的x分量在两个方向上展开。
这个盒子的高度将由 [page:Vector3 vector] 两个方向上的y分量展开。
这个盒子的深度将由 [page:Vector3 vector] z分量在两个方向上展开。
Expands this box equilaterally by [page:Vector3 vector]. The width of this box will be
expanded by the x component of [page:Vector3 vector] in both directions. The height of
this box will be expanded by the y component of [page:Vector3 vector] in both directions.
The depth of this box will be expanded by the z component of *vector* in both directions.
</p>
<h3>[method:Sphere getBoundingSphere]( [param:Sphere target] )</h3>
<p>
[page:Sphere target] — the result will be copied into this Sphere.<br /><br />
[page:Sphere target] — 如果指定了target ,结果将会被拷贝到target。<br /><br />
Gets a [page:Sphere] that bounds the box.
获取一个包围球 [page:Sphere]。
</p>
<h3>[method:Vector3 getCenter]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 target] — 如果指定了target ,结果将会被拷贝到target。<br /><br />
Returns the center point of the box as a [page:Vector3].
返回包围盒的中心点 [page:Vector3]。
</p>
<h3>[method:Vector3 getParameter]( [param:Vector3 point], [param:Vector3 target] ) </h3>
<p>
[page:Vector3 point] - [page:Vector3].<br/>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 target] — 如果指定了target ,结果将会被拷贝到target。<br /><br />
Returns a point as a proportion of this box's width and height.
返回一个点为这个盒子的宽度和高度的比例。
</p>
<h3>[method:Vector3 getSize]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 target] — 如果指定了target ,结果将会被拷贝到target。<br /><br />
Returns the width, height and depth of this box.
返回包围盒的宽度,高度,和深度。
</p>
<h3>[method:Box3 intersect]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - Box to intersect with.<br /><br />
[page:Box3 box] - 与包围盒的交集<br /><br />
Returns the intersection of this and [page:Box3 box], setting the upper bound of this box to the lesser
of the two boxes' upper bounds and the lower bound of this box to the greater of the two boxes'
lower bounds.
返回此包围盒和 [page:Box3 box] 的交集,将此框的上界设置为两个框的max的较小部分,
将此包围盒的下界设置为两个包围盒的min的较大部分。
</p>
<h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - Box to check for intersection against.<br /><br />
[page:Box3 box] - 用来检测是否相交的包围盒<br /><br />
Determines whether or not this box intersects [page:Box3 box].
确定当前包围盒是否与传入包围盒[page:Box3 box] 相交。
</p>
<h3>[method:Boolean intersectsPlane]( [param:Plane plane] )</h3>
<p>
[page:Plane plane] - [page:Plane] to check for intersection against.<br /><br />
[page:Plane plane] - 用来检测是否相交的 [page:Plane]。<br /><br />
Determines whether or not this box intersects [page:Plane plane].
确定当前包围盒是否与平面 [page:Plane plane] 相交。
</p>
<h3>[method:Boolean intersectsSphere]( [param:Sphere sphere] )</h3>
<p>
[page:Sphere sphere] - [page:Sphere] to check for intersection against.<br /><br />
[page:Sphere sphere] - 用来检测是否相交的球体 [page:Sphere]。<br /><br />
Determines whether or not this box intersects [page:Sphere sphere].
确定当前包围盒是否与球体 [page:Sphere sphere] 相交。
</p>
<h3>[method:Boolean intersectsTriangle]( [param:Triangle triangle] )</h3>
<p>
[page:Triangle triangle] - [page:Triangle] to check for intersection against.<br /><br />
[page:Triangle triangle] - 用来检测是否相交的三角形 [page:Triangle]。<br /><br />
Determines whether or not this box intersects [page:Triangle triangle].
确定当前包围盒是否与三角形 [page:Triangle triangle] 相交。
</p>
<h3>[method:Boolean isEmpty]()</h3>
<p>
Returns true if this box includes zero points within its bounds.<br>
Note that a box with equal lower and upper bounds still includes one point,
the one both bounds share.
如果这个盒子包含0个顶点,则返回true。<br>
注意,下界和上界相等的方框仍然包含一个点,即两个边界共享的那个点。
</p>
<h3>[method:Box3 makeEmpty]()</h3>
<p>Makes this box empty.</p>
<p>清空包围盒。</p>
<h3>[method:Box3 set]( [param:Vector3 min], [param:Vector3 max] )</h3>
<p>
[page:Vector3 min] - [page:Vector3] representing the lower (x, y, z) boundary of the box.<br />
[page:Vector3 max] - [page:Vector3] representing the lower upper (x, y, z) boundary of the box.<br /><br />
[page:Vector3 min] - [page:Vector3] 表示下边界每个纬度(x,y,z)的值。<br />
[page:Vector3 max] - [page:Vector3] 表示上边界每个纬度(x,y,z)的值。<br /><br />
Sets the lower and upper (x, y, z) boundaries of this box.
设置包围盒上下边界每个纬度(x,y,z)的值。
</p>
<h3>[method:Box3 setFromArray]( [param:Array array] ) [param:Box3 this]</h3>
<p>
array -- An array of position data that the resulting box will envelop.<br /><br />
array -- 数组当中的所有的点都将被包围盒包裹。<br /><br />
Sets the upper and lower bounds of this box to include all of the data in *array*.
设置包围盒的上下边界使得数组 *array* 中的所有点的点都被包含在内。
</p>
<h3>[method:Box3 setFromBufferAttribute]( [param:BufferAttribute attribute] ) [param:Box3 this]</h3>
<p>
[page:BufferAttribute attribute] - A buffer attribute of position data that the resulting box will envelop.<br /><br />
[page:BufferAttribute attribute] - 位置的缓冲数据,包含在返回的包围盒内。<br /><br />
Sets the upper and lower bounds of this box to include all of the data in [page:BufferAttribute attribute].
设置此包围盒的上边界和下边界,以包含 [page:BufferAttribute attribute] 中的所有位置数据。
</p>
<h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] )</h3>
<!-- <h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] )</h3>
<p>
[page:Vector3 center] - Desired center position of the box ([page:Vector3]). <br>
[page:Vector3 size] - Desired x, y and z dimensions of the box ([page:Vector3]).<br /><br />
[page:Vector3 center] - 包围盒的中心位置 ([page:Vector3]). <br>
[page:Vector3 size] - 需要设置包围盒x,y,z的分量 ([page:Vector3]).<br /><br />
Centers this box on [page:Vector3 center] and sets this box's width and height to the values specified
in [page:Vector3 size].
</p>
将包围盒的中心点设为 [page:Vector3 center] ,然后将包围盒的宽高设为指定的 [page:Vector3 size]。
</p>-->
<h3>[method:Box3 setFromCenterAndSize]( [param:Vector3 center], [param:Vector3 size] ) [param:Box3 this]</h3>
<p>
[page:Vector3 center], - Desired center position of the box. <br>
[page:Vector3 size] - Desired x, y and z dimensions of the box.<br /><br />
[page:Vector3 center], - 包围盒所要设置的中心位置。 <br>
[page:Vector3 size] - 包围盒所要设置的x、y和z尺寸(宽/高/长)。<br /><br />
Centers this box on [page:Vector3 center] and sets this box's width, height and depth to the values specified <br>
in [page:Vector3 size]
将当前包围盒的中心点设置为 [page:Vector3 center] ,并将此包围盒的宽度,高度和深度设置为大小指定 [page:Vector3 size] 的值。
</p>
<h3>[method:Box3 setFromObject]( [param:Object3D object] )</h3>
<p>
[page:Object3D object] - [page:Object3D] to compute the bounding box of.<br /><br />
[page:Object3D object] - 用来计算包围盒的3D对象 [page:Object3D]。<br /><br />
Computes the world-axis-aligned bounding box of an [page:Object3D] (including its children),
accounting for the object's, and children's, world transforms.
计算和世界轴对齐的一个对象 [page:Object3D] (含其子对象)的包围盒,计算对象和子对象的世界坐标变换。
</p>
<h3>[method:Box3 setFromPoints]( [param:Array points] )</h3>
<p>
[page:Array points] - Array of [page:Vector3 Vector3s] that the resulting box will contain.<br /><br />
[page:Array points] - 计算出的包围盒将包含数组中所有的点 [page:Vector3 Vector3s]<br /><br />
Sets the upper and lower bounds of this box to include all of the points in [page:Array points].
设置此包围盒的上边界和下边界,以包含数组 [page:Array points] 中的所有点。
</p>
<h3>[method:Box3 translate]( [param:Vector3 offset] )</h3>
<p>
[page:Vector3 offset] - Direction and distance of offset.<br /><br />
[page:Vector3 offset] - 偏移方向和距离。<br /><br />
Adds [page:Vector3 offset] to both the upper and lower bounds of this box, effectively moving this box
[page:Vector3 offset] units in 3D space.
给包围盒的上下边界添加偏移量 [page:Vector3 offset],这样可以有效的在3D空间中移动包围盒。
偏移量为 [page:Vector3 offset] 大小。
</p>
<h3>[method:Box3 union]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - Box that will be unioned with this box.<br /><br />
[page:Box3 box] - 要结合在一起的包围盒。<br /><br />
Unions this box with [page:Box3 box], setting the upper bound of this box to the greater of the
two boxes' upper bounds and the lower bound of this box to the lesser of the two boxes'
lower bounds.
在 [page:Box3 box] 参数的上边界和已有box对象的上边界之间取较大者,而对两者的下边界取较小者,这样获得一个新的较大的联合盒子。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,15 +8,15 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>颜色([name])</h1>
<p class="desc">
Class representing a color.
表示一个颜色。
</p>
<h2>Examples</h2>
A Color can be initialised in any of the following ways:
<h2>示例(Examples)</h2>
颜色可以用以下任意一种方式初始化。
<code>
//empty constructor - will default white
var color = new THREE.Color();
......@@ -41,25 +41,25 @@ var color = new THREE.Color( 1, 0, 0 );
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Color_Hex_or_String r], [param:Float g], [param:Float b] )</h3>
<p>
[page:Color_Hex_or_String r] - (optional) If arguments [page:Float g] and [page:Float b] are defined, the red component of the color.
If they are not defined, it can be a [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] (recommended), a CSS-style string, or another Color instance.<br />
[page:Float g] - (optional) If it is defined, the green component of the color.<br />
[page:Float b] - (optional) If it is defined, the blue component of the color.<br /><br />
[page:Color_Hex_or_String r] - (可选参数) 如果参数g和b被定义,则r表示颜色中的红色分量。
如果未被定义,r可以是一个十六进制 [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] 颜色值或CSS样式的字符串或一个Color实例。<br />
[page:Float g] - (可选参数) 如果被定义,表示颜色中的绿色分量。<br />
[page:Float b] - (可选参数) 如果被定义,表示颜色中的蓝色分量。<br /><br />
Note that standard method of specifying color in three.js 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 />
注意使用十六进制 [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] 定义一个颜色在three.js中是标准的方法,而且其余
文档也将会使用这个方法。<br /><br />
When all arguments are defined then [page:Color_Hex_or_String r] is the red component, [page:Float g] is the green component and [page:Float b] is the blue component of the color.<br />
When only [page:Color_Hex_or_String r] is defined:<br />
当所有参数被定义时,r是红色分量,g是绿色分量,b是蓝色分量。<br />
当只有 [page:Color_Hex_or_String r] 被定义时:<br />
<ul>
<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 example:
<li>它可用一个十六进制 [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] 值表示颜色(推荐)。</li>
<li>它可以是一个另一个颜色实例。</li>
<li>它可以是另外一个CSS样式。例如:
<ul>
<li>'rgb(250, 0,0)'</li>
<li>'rgb(100%,0%,0%)'</li>
......@@ -73,28 +73,28 @@ var color = new THREE.Color( 1, 0, 0 );
</ul>
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Boolean isColor]</h3>
<p>
Used to check whether this or derived classes are Colors. Default is *true*.<br /><br />
用来检测此类或者派生类是否为颜色。默认值是 *true*。<br /><br />
You should not change this, as it used internally for optimisation.
不应该去改变这个值,因为它在内部用于优化。
</p>
<h3>[property:Float r]</h3>
<p>
Red channel value between 0 and 1. Default is 1.
红色通道的值在0到1之间。默认值为1。
</p>
<h3>[property:Float g]</h3>
<p>
Green channel value between 0 and 1. Default is 1.
绿色通道的值在0到1之间。默认值为1。
</p>
<h3>[property:Float b]</h3>
<p>
Blue channel value between 0 and 1. Default is 1.
蓝色通道的值在0到1之间。默认值为1。
</p>
......@@ -102,102 +102,99 @@ var color = new THREE.Color( 1, 0, 0 );
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Color add]( [param:Color color] ) </h3>
<p>Adds the RGB values of [page:Color color] to the RGB values of this color.</p>
<p>将给定颜色的RGB值添加到此颜色的RGB值。</p>
<h3>[method:Color addColors]( [param:Color color1], [param:Color color2] ) </h3>
<p>Sets this color's RGB values to the sum of the RGB values of [page:Color color1] and [page:Color color2].</p>
<p>将此颜色的RGB值设置为 [page:Color color1] 和 [page:Color color2] 的RGB值之和。</p>
<h3>[method:Color addScalar]( [param:Number s] ) </h3>
<p>Adds [page:Number s] to the RGB values of this color.</p>
<p>给现有的RGB值都加上 [page:Number s] 。</p>
<h3>[method:Color clone]() </h3>
<p>Returns a new Color with the same [page:.r r], [page:.g g] and [page:.b b] values as this one.</p>
<p>返回一个与当前颜色的 [page:.r r], [page:.g g] 和 [page:.b b] 相同的颜色。</p>
<h3>[method:Color copy]( [param:Color color] ) </h3>
<p>
Copies the [page:.r r], [page:.g g] and [page:.b b] parameters from [page:Color color] in to this color.
从 [page:Color color] 中拷贝 [page:.r r], [page:.g g] 和 [page:.b b] 值到当前的颜色。
</p>
<h3>[method:Color convertGammaToLinear]( [param:Float gammaFactor] ) </h3>
<p>
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
Converts this color from gamma space to linear space by taking [page:.r r], [page:.g g] and [page:.b b] to the power of [page:Float gammaFactor].
[page:Float gammaFactor] - (可选参数). 默认值 *2.0*.<br /><br />
通过取颜色 [page:.r r], [page:.g g] and [page:.b b] 的 [page:Float gammaFactor] 次方将颜色从伽马空间转换成线性空间。
</p>
<h3>[method:Color convertLinearToGamma]( [param:Float gammaFactor] ) </h3>
<p>
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
Converts this color from linear space to gamma space by taking [page:.r r], [page:.g g] and [page:.b b] to the power of 1 / [page:Float gammaFactor].
[page:Float gammaFactor] - (可选参数). 默认值 *2.0*.<br /><br />
通过取颜色 [page:.r r], [page:.g g] and [page:.b b] 的 1/[page:Float gammaFactor] 次方将颜色从线性空间转换成伽马空间。
</p>
<h3>[method:Color convertLinearToSRGB]() </h3>
<p>
Converts this color from linear space to sRGB space.
将此颜色从线性空间转换成sRGB空间。
</p>
<h3>[method:Color convertSRGBToLinear]() </h3>
<p>
Converts this color from sRGB space to linear space.
将此颜色从sRGB空间转换成线性空间。
</p>
<h3>[method:Color copyGammaToLinear]( [param:Color color], [param:Float gammaFactor] ) </h3>
<p>
[page:Color color] — Color to copy.<br />
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
[page:Color color] — 需要拷贝的颜色。<br />
[page:Float gammaFactor] - (可选参数). 默认值为 *2.0*.<br /><br />
Copies the given color into this color, and then converts this color from gamma space to linear space
by taking [page:.r r], [page:.g g] and [page:.b b] to the power of [page:Float gammaFactor].
将传入的 [param:Color color] 从伽马空间转换到线性空间然后复制给当前颜色。
</p>
<h3>[method:Color copyLinearToGamma]( [param:Color color], [param:Float gammaFactor] ) </h3>
<p>
[page:Color color] — Color to copy.<br />
[page:Float gammaFactor] - (optional). Default is *2.0*.<br /><br />
[page:Color color] — 需要拷贝的颜色。<br />
[page:Float gammaFactor] - (可选参数). 默认值为 *2.0*.<br /><br />
Copies the given color into this color, and then converts this color from linear space to gamma space
by taking [page:.r r], [page:.g g] and [page:.b b] to the power of 1 / [page:Float gammaFactor].
将传入的 [param:Color color] 从线性空间转换到伽马空间然后复制给当前颜色。
</p>
<h3>[method:Color copyLinearToSRGB]( [param:Color color]] ) </h3>
<p>
[page:Color color] — Color to copy.<br />
[page:Color color] — 需要拷贝的颜色。<br />
Copies the given color into this color, and then converts this color from linear space to sRGB space.
将传入的 [param:Color color] 拷贝给当前颜色,然后将当前颜色从线性空间转换到sRGB空间。
</p>
<h3>[method:Color copySRGBToLinear]( [param:Color color] ) </h3>
<p>
[page:Color color] — Color to copy.<br />
[page:Color color] — 需要拷贝的颜色。<br />
Copies the given color into this color, and then converts this color from sRGB space to linear space.
将传入的 [param:Color color] 拷贝给当前颜色,然后将当前颜色从sRGB空间转换到线性空间。
</p>
<h3>[method:Boolean equals]( [param:Color color] ) </h3>
<p>Compares the RGB values of [page:Color color] with those of this object. Returns true if they are the same, false otherwise.</p>
<p>将 [param:Color color] 的RGB值与该对象的RGB值进行比较。如果它们都是相同的,返回true,否则返回false。</p>
<h3>[method:Color fromArray]( [param:Array array], [param:Integer offset] ) </h3>
<p>
[page:Array array] - [page:Array] of floats in the form [ [page:Float r], [page:Float g], [page:Float b] ].<br />
[page:Integer offset] - An optional offset into the array.<br /><br />
[page:Array array] - 格式为 [ [page:Float r], [page:Float g], [page:Float b] ] 的数组 [page:Array]。<br />
[page:Integer offset] - 数组中可选偏移量<br /><br />
Sets this color's components based on an array formatted like [ [page:Float r], [page:Float g], [page:Float b] ].
从格式为[ [page:Float r], [page:Float g], [page:Float b] ]的数组数据中来创建Color对象。
</p>
<h3>[method:Integer getHex]()</h3>
<p>Returns the hexadecimal value of this color.</p>
<p>返回此颜色的十六进制值。</p>
<h3>[method:String getHexString]()</h3>
<p>Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').</p>
<p>将此颜色的十六进制值作为字符串返回 (例如, 'FFFFFF')。</p>
<h3>[method:Object getHSL]( [param:Object target] )</h3>
<p>
[page:Object target] — the result will be copied into this Object. Adds h, s and l keys to the object (if not already present).<br /><br />
[page:Object target] — 结果将复制到这个对象中。向对象添加h、s和l键(如果不存在)。<br /><br />
Convert this Color's [page:.r r], [page:.g g] and [page:.b b] values to [link:https://en.wikipedia.org/wiki/HSL_and_HSV HSL]
format and returns an object of the form:
将此颜色的 [page:.r r], [page:.g g] 和 [page:.b b] 值转换为 [link:https://en.wikipedia.org/wiki/HSL_and_HSV HSL]格式,然后返回一个格式如下的对象:
<code>
{ h: 0, s: 0, l: 0 }
......@@ -206,117 +203,113 @@ var color = new THREE.Color( 1, 0, 0 );
</p>
<h3>[method:String getStyle]()</h3>
<p>Returns the value of this color as a CSS style string. Example: 'rgb(255,0,0)'.</p>
<p>以CSS样式字符串的形式返回该颜色的值。例如:“rgb(255,0,0)”。</p>
<h3>[method:Color lerp]( [param:Color color], [param:Float alpha] ) </h3>
<p>
[page:Color color] - color to converge on.<br />
[page:Float alpha] - interpolation factor in the closed interval [0, 1].<br /><br />
[page:Color color] - 用于收敛的颜色。<br />
[page:Float alpha] - 介于0到1的数字。<br /><br />
Linearly interpolates this color's RGB values toward the RGB values of the passed argument.
The alpha argument can be thought of as the ratio between the two colors, where 0.0 is
this color and 1.0 is the first argument.
将该颜色的RGB值线性插值到传入参数的RGB值。alpha参数可以被认为是两种颜色之间的比例值,其中0是当前颜色和1.0是第一个参数的颜色。
</p>
<h3>[method:Color lerpHSL]( [param:Color color], [param:Float alpha] ) </h3>
<p>
[page:Color color] - color to converge on.<br />
[page:Float alpha] - interpolation factor in the closed interval [0, 1].<br /><br />
Linearly interpolates this color's HSL values toward the HSL values of the passed argument.
It differs from the classic [page:.lerp] by not interpolating straight from one color to the other,
but instead going through all the hues in between those two colors.
The alpha argument can be thought of as the ratio between the two colors, where 0.0 is
this color and 1.0 is the first argument.
[page:Color color] - 用于收敛的颜色。<br />
[page:Float alpha] - 介于0到1的数字。<br /><br />
将该颜色的HSL值线性插值到传递参数的HSL值。它不同于上诉的[page:lerp]。通过不直接从一种颜色插入到另一种颜色,
而是通过插值这两种颜色之间的所有色相(H)、亮度(L)、饱和度(S)。alpha参数可以被认为是两种颜色之间的比例值,
其中0是当前颜色和1.0是第一个参数的颜色。
</p>
<h3>[method:Color multiply]( [param:Color color] ) </h3>
<p>Multiplies this color's RGB values by the given [page:Color color]'s RGB values.</p>
<p>将此颜色的RGB值乘以给定的[page: color color]的RGB值。</p>
<h3>[method:Color multiplyScalar]( [param:Number s] ) </h3>
<p>Multiplies this color's RGB values by [page:Number s].</p>
<p>将此颜色的RGB值乘以给定的[page:Number s]的值。</p>
<h3>[method:Color offsetHSL]( [param:Float h], [param:Float s], [param:Float l] ) </h3>
<p>
Adds the given [page:Float h], [page:Float s], and [page:Float l] to this color's values.
Internally, this converts the color's [page:.r r], [page:.g g] and [page:.b b] values to HSL, adds
[page:Float h], [page:Float s], and [page:Float l], and then converts the color back to RGB.
将给定的 [page:Float h], [page:Float s], 和 [page:Float l]值加到当前颜色值。
内部的机制为:先将该颜色的 [page:.r r], [page:.g g] 和 [page:.b b] 值转换为HSL,然后与传入的[page:Float h], [page:Float s], 和 [page:Float l]
相加,最后再将结果转成RGB值。
</p>
<h3>[method:Color set]( [param:Color_Hex_or_String value] ) </h3>
<p>
[page:Color_Hex_or_String value] - Value to set this color to.<br /><br />
[page:Color_Hex_or_String value] - 用于设置该颜色的值。<br /><br />
See the Constructor above for full details of what [page:Color_Hex_or_String value] can be.
Delegates to [page:.copy], [page:.setStyle], or [page:.setHex] depending on input type.
有关 [page:Color_Hex_or_String value] 的详细信息,请参阅上面的构造函数。
根据输入类型,将会委托给 [page:.copy], [page:.setStyle], 或者 [page:.setHex] 函数处理。
</p>
<h3>[method:Color setHex]( [param:Integer hex] ) </h3>
<p>
[page:Integer hex] — [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] format.<br /><br />
[page:Integer hex] — [link:https://en.wikipedia.org/wiki/Web_colors#Hex_triplet hexadecimal triplet] 格式。<br /><br />
采用十六进制值设置此颜色。
Sets this color from a hexadecimal value.
</p>
<h3>[method:Color setHSL]( [param:Float h], [param:Float s], [param:Float l] ) </h3>
<p>
[page:Float h] — hue value between 0.0 and 1.0 <br />
[page:Float s] — saturation value between 0.0 and 1.0 <br />
[page:Float l] — lightness value between 0.0 and 1.0<br /><br />
[page:Float h] — 色相值处于0到1之间。hue value between 0.0 and 1.0 <br />
[page:Float s] — 饱和度值处于0到1之间。<br />
[page:Float l] — 亮度值处于0到1之间。<br /><br />
Sets color from HSL values.
采用HLS值设置此颜色。
</p>
<h3>[method:Color setRGB]( [param:Float r], [param:Float g], [param:Float b] ) </h3>
<p>
[page:Float r] — Red channel value between 0.0 and 1.0.<br />
[page:Float g] — Green channel value between 0.0 and 1.0.<br />
[page:Float b] — Blue channel value between 0.0 and 1.0.<br /><br />
[page:Float r] — 红色通道的值在0到1之间。<br />
[page:Float g] — 绿色通道的值在0到1之间。<br />
[page:Float b] — 蓝色通道的值在0到1之间。<br /><br />
Sets this color from RGB values.
采用RGB值设置此颜色。
</p>
<h3>[method:Color setScalar]( [param:Float scalar] ) </h3>
<p>
[page:Float scalar] — a value between 0.0 and 1.0.<br /><br />
[page:Float scalar] — 处于0到1之间的值<br /><br />
Sets all three color components to the value [page:Float scalar].
将颜色的RGB值都设为该 [page:Float scalar] 的值。
</p>
<h3>[method:Color setStyle]( [param:String style] ) </h3>
<p>
[page:String style] — color as a CSS-style string.<br /><br />
[page:String style] — 颜色css样式的字符串<br /><br />
Sets this color from a CSS-style string. For example,
采用ccs样式的字符串设置此颜色。例如,
"rgb(250, 0,0)",
"rgb(100%, 0%, 0%)",
"hsl(0, 100%, 50%)",
"#ff0000",
"#f00", or
"red" ( or any [link:https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart X11 color name]
- all 140 color names are supported ).<br />
"#f00", 或者
"red" ( 或者任何 [link:https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart X11 color name]
- 所有140种颜色名称都支持 ).<br />
Translucent 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.<br /><br />
半透明颜色例如 "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" 也能支持,
但是alpha通道的值将会被丢弃。<br /><br />
Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange' (all lowercase).
注意,对于X11颜色名称,多个单词(如暗橙色)变成字符串“darkorange”(全部是小写字母)。
</p>
<h3>[method:Color sub]( [param:Color color] ) </h3>
<p>
Subtracts the RGB components of the given color from the RGB components of this color.
If this results in a negative component, that component is set to zero.
从该颜色的RGB分量中减去传入颜色的RGB分量。如果分量结果是负,则该分量为零。
</p>
<h3>[method:Array toArray]( [param:Array array], [param:Integer offset] ) </h3>
<p>
[page:Array array] - An optional array to store the color to. <br />
[page:Integer offset] - An optional offset into the array.<br /><br />
[page:Array array] - 存储颜色的可选数组 <br />
[page:Integer offset] - 数组的可选偏移量<br /><br />
Returns an array of the form [ r, g, b ].
返回一个格式为[ r, g, b ] 数组。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,26 +8,25 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>圆柱体[name]</h1>
<p class="desc">
A point's [link:https://en.wikipedia.org/wiki/Cylindrical_coordinate_system cylindrical coordinates].
</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Float radius], [param:Float theta], [param:Float y] )</h3>
<p>
[page:Float radius] - distance from the origin to a point in the x-z plane.
Default is *1.0*.<br />
[page:Float theta] - counterclockwise angle in the x-z plane measured in radians
from the positive z-axis. Default is *0*.<br />
[page:Float y] - height above the x-z plane. Default is *0*.
[page:Float radius] - 从原点到x-z平面上一点的距离
默认值为 *1.0*.<br />
[page:Float theta] - 在x-z平面内的逆时针角度,以z轴正方向的计算弧度。默认值为0。<br />
[page:Float y] - x-z平面以上的高度 默认值为 *0*.
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Float radius]</h3>
......@@ -40,33 +39,32 @@
<h3>[method:Cylindrical clone]()</h3>
<p>
Returns a new cylindrical with the same [page:.radius radius], [page:.theta theta]
and [page:.y y] properties as this one.
返回一个与当前拥有相同 [page:.radius radius], [page:.theta theta] 和 [page:.y y] 属性的圆柱体。
</p>
<h3>[method:Cylindrical copy]( [param:Cylindrical other] )</h3>
<p>
Copies the values of the passed Cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties to this cylindrical.
将传入的圆柱体对象的 [page:.radius radius], [page:.theta theta] 和 [page:.y y] 属性赋给当前对象。
</p>
<h3>[method:Cylindrical set]( [param:Float radius], [param:Float theta], [param:Float y] )</h3>
<p>Sets values of this cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties.</p>
<p>设置该对象的 [page:.radius radius], [page:.theta theta]
和 [page:.y y] 属性。</p>
<h3>[method:Cylindrical setFromVector3]( [param:Vector3 vec3] )</h3>
<p>
Sets values of this cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties from the [page:Vector3 Vector3].
从 [page:Vector3 Vector3] 中取x,y,z,并调用setFromCartesianCoords来设置圆柱体的
[page:.radius radius]、[page:.theta theta] 和 [page:.y y] 的属性值。
</p>
<h3>[method:Cylindrical setFromCartesianCoords]( [param:Float x], [param:Float y], [param:Float z] )</h3>
<p>
Sets values of this cylindrical's [page:.radius radius], [page:.theta theta]
and [page:.y y] properties from Cartesian coordinates.
使用笛卡尔坐标来设置该圆柱体的 [page:.radius radius], [page:.theta theta]
and [page:.y y] 属性值。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -11,13 +11,11 @@
<h1>[name]</h1>
<p class="desc">
A class representing [link:http://en.wikipedia.org/wiki/Euler_angles Euler Angles].<br /><br />
Euler angles describe a rotational transformation by rotating an object on its various
axes in specified amounts per axis, and a specified axis order.
表示 [link:http://en.wikipedia.org/wiki/Euler_angles Euler] 的类。<br /><br />
欧拉角描述一个旋转变换,通过指定轴顺序和其各个轴向上的指定旋转角度来旋转一个物体。
</p>
<h2>Example</h2>
<h2>示例(Example)</h2>
<code>var a = new THREE.Euler( 0, 1, 1.57, 'XYZ' );
var b = new THREE.Vector3( 1, 0, 1 );
......@@ -25,167 +23,158 @@
</code>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )</h3>
<p>
[page:Float x] - (optional) the angle of the x axis in radians. Default is *0*.<br />
[page:Float y] - (optional) the angle of the y axis in radians. Default is *0*.<br />
[page:Float z] - (optional) the angle of the z axis in radians. Default is *0*.<br />
[page:String order] - (optional) a string representing the order that the rotations are applied,
defaults to 'XYZ' (must be upper case).<br /><br />
[page:Float x] - (optional) 用弧度表示x轴旋转量。 默认值是 *0*。<br />
[page:Float y] - (optional) 用弧度表示y轴旋转量。 默认值是 *0*。<br />
[page:Float z] - (optional) 用弧度表示z轴旋转量。 默认值是 *0*。<br />
[page:String order] - (optional) 表示旋转顺序的字符串,默认为'XYZ'(必须是大写)。<br /><br />
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Boolean isEuler]</h3>
<p>
Used to check whether this or derived classes are Eulers. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
用于判定此对象或者此类的派生对象是否是欧拉角。默认值为 *true*。<br /><br />
不应该改变该值,因为它在内部用于优化。
</p>
<h3>[property:String order]</h3>
<p>
The order in which to apply rotations. Default is 'XYZ', which means that the object will first be
rotated around its X axis, then its Y axis and finally its Z axis. Other possibilities are:
'YZX', 'ZXY', 'XZY', 'YXZ' and 'ZYX'. These must be in upper case.<br /><br />
order值应用于旋转顺序。默认值为 'XYZ',这意味着对象将首先是
绕X轴旋转,然后是Y轴,最后是Z轴。其他可能性包括:
'YZX', 'ZXY', 'XZY', 'YXZ'和'ZYX'。这些必须是大写字母。<br /><br />
Three.js 使用<em>intrinsic</em> Tait-Bryan angles(Yaw、Pitch、Roll)。
这意味着旋转是在<em>本地</em>坐标系下进行的。也就是说,对于“XYZ”订单,首先是围绕local-X轴旋转(与world- x轴相同),
然后是local-Y(现在可能与world y轴不同),然后是local-Z(可能与world z轴不同)。<br /><br />
Three.js uses <em>intrinsic</em> Tait-Bryan angles. This means that rotations are performed with respect
to the <em>local</em> coordinate system. That is, for order 'XYZ', the rotation is first around the local-X
axis (which is the same as the world-X axis), then around local-Y (which may now be different from the
world Y-axis), then local-Z (which may be different from the world Z-axis).<br /><br />
If the order is changed, [page:.onChangeCallback onChangeCallback] will be called.
如果order值被改变,[page:.onChangeCallback onChangeCallback] 会被调用。
</p>
<h3>[property:Float x]</h3>
<p>
The current value of the x component.<br /><br />
当前x分量的值。<br /><br />
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
如果这个值发生变化,[page:.onChangeCallback onChangeCallback] 会被调用。
</p>
<h3>[property:Float y]</h3>
<p>
The current value of the y component.<br /><br />
当前y分量的值。<br /><br />
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
如果这个值发生变化,[page:.onChangeCallback onChangeCallback] 会被调用。
</p>
<h3>[property:Float z]</h3>
<p>
The current value of the z component.<br /><br />
当前z分量的值。<br /><br />
If this is changed, [page:.onChangeCallback onChangeCallback] will be called.
如果这个值发生变化,[page:.onChangeCallback onChangeCallback] 会被调用。
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Euler copy]( [param:Euler euler] )</h3>
<p>Copies value of [page:Euler euler] to this euler.</p>
<p>将 [page:Euler euler] 的属性拷贝到当前对象。</p>
<h3>[method:Euler clone]()</h3>
<p>Returns a new Euler with the same parameters as this one.</p>
<p>返回一个与当前参数相同的新欧拉角。</p>
<h3>[method:Boolean equals]( [param:Euler euler] )</h3>
<p>Checks for strict equality of this euler and [page:Euler euler].</p>
<p>检查 [page:Euler euler] 是否与当前对象相同。</p>
<h3>[method:Euler fromArray]( [param:Array array] )</h3>
<p>
[page:Array array] of length 3 or 4. The optional 4th argument corresponds to the [page:.order order].<br /><br />
Assigns this euler's [page:.x x] angle to array[0]. <br />
Assigns this euler's [page:.y y] angle to array[1]. <br />
Assigns this euler's [page:.z z] angle to array[2]. <br />
Optionally assigns this euler's [page:.order order] to array[3].
长度为3或4的一个 [page:Array array] 。array[3] 是一个可选的 [page:.order order] 参数。<br /><br />
将欧拉角的x分量设置为 array[0]。 <br />
将欧拉角的x分量设置为 array[1]。 <br />
将欧拉角的x分量设置为 array[2]。 <br />
将array[3]设置给欧拉角的 [page:.order order] 。可选。
</p>
<h3>[method:Euler onChange]( [param:Function onChangeCallback] )</h3>
<p>
[page:Function onChangeCallback] - set the value of the onChangeCallback() function.
[page:Function onChangeCallback] - 为 onChangeCallback() 函数赋值。
</p>
<h3>[method:Euler onChangeCallback]( )</h3>
<p>
By default this is an empty function, however it can be set via [page:.onChange onChange]().<br />
It gets called after changing the [page:.x x], [page:.y y], [page:.z z] or [page:.order order] properties,
and also after calling most setter functions (see those for details).
默认情况下,这个函数为空,但是它可以通过[page:.onChange onChange]()来设置。<br />
在更改 [page:.x x], [page:.y y], [page:.z z] 或 [page:.order order] 属性之后调用它,
在调用大多数setter函数之后也会调用它(详细信息请参阅那些函数)。
</p>
<h3>[method:Euler reorder]( [param:String newOrder] )</h3>
<p>
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 /><br />
通过这个欧拉角创建一个四元数,然后用这个四元数和新顺序设置这个欧拉角。 <br /><br />
<em>WARNING</em>: this discards revolution information.
<em>警告</em>: 这将弃用旋转信息。
</p>
<h3>[method:Euler set]( [param:Float x], [param:Float y], [param:Float z], [param:String order] )</h3>
<p>
[page:.x x] - the angle of the x axis in radians.<br />
[page:.y y] - the angle of the y axis in radians.<br />
[page:.z z] - the angle of the z axis in radians.<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
[page:.x x] - 用弧度表示x轴旋转量。<br />
[page:.y y] - 用弧度表示y轴旋转量。<br />
[page:.z z] - 用弧度表示z轴旋转量。<br />
[page:.order order] - (optional) 表示旋转顺序的字符串。<br /><br />
Sets the angles of this euler transform and optionally the [page:.order order] and then call [page:.onChangeCallback onChangeCallback]().
设置该欧拉变换的角度和旋转顺序 [page:.order order] ,然后调用 [page:.onChangeCallback onChangeCallback]()。
</p>
<h3>[method:Euler setFromRotationMatrix]( [param:Matrix4 m], [param:String order], [param:Boolean update] )</h3>
<p>
[page:Matrix4 m] - a [page:Matrix4] of which the upper 3x3 of matrix is a pure
[link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix] (i.e. unscaled).<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
[page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
the matrix.<br /><br />
[page:Matrix4 m] - [page:Matrix4] 矩阵上面的3x3部分是一个纯旋转矩阵[link:https://en.wikipedia.org/wiki/Rotation_matrix rotation matrix]
(也就是不发生缩放)<br />
[page:.order order] - (可选参数) 表示旋转顺序的字符串。<br />
[page:Boolean update] - (可选参数) 表示设置完变换矩阵后是否调用 [page:.onChangeCallback onChangeCallback]。<br /><br />
Sets the angles of this euler transform from a pure rotation matrix based on the orientation
specified by order.
使用基于 [page:.order order] 顺序的纯旋转矩阵来设置当前欧拉角。
</p>
<h3>[method:Euler setFromQuaternion]( [param:Quaternion q], [param:String order], [param:Boolean update] )</h3>
<p>
[page:Quaternion q] - a normalized quaternion.<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br />
[page:Boolean update] - (optional) whether to call [page:.onChangeCallback onChangeCallback]() after applying
the matrix.<br /><br />
[page:Quaternion q] - 归一化的四元数。<br />
[page:.order order] - (可选参数) 表示旋转顺序的字符串。<br />
[page:Boolean update] - (可选参数) 表示设置完变换矩阵后是否调用 [page:.onChangeCallback onChangeCallback]。<br /><br />
Sets the angles of this euler transform from a normalized quaternion based on the orientation
specified by [page:.order order].
根据 [page:.order order] 指定的方向,使用归一化四元数设置这个欧拉变换的角度。
</p>
<h3>[method:Euler setFromVector3]( [param:Vector3 vector], [param:String order] )</h3>
<p>
[page:Vector3 vector] - [page:Vector3].<br />
[page:.order order] - (optional) a string representing the order that the rotations are applied.<br /><br />
[page:.order order] - (可选参数) 表示旋转顺序的字符串。<br /><br />
Set the [page:.x x], [page:.y y] and [page:.z z], and optionally update the [page:.order order]. [page:.onChangeCallback onChangeCallback]()
is called after these changes are made.
设置 [page:.x x], [page:.y y] and [page:.z z] 并且选择性更新 [page:.order order]。
更改完成之后调用 [page:.onChangeCallback onChangeCallback]()。
</p>
<h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3>
<p>
[page:Array array] - (optional) array to store the euler in.<br />
[page:Integer offset] (optional) offset in the array.<br />
[page:Array array] - (可选参数) 存储欧拉角的数组。<br />
[page:Integer offset] (可选参数) 数组的偏移量。<br />
Returns an array of the form [[page:.x x], [page:.y y], [page:.z z], [page:.order order ]].
返回一个数组:[[page:.x x], [page:.y y], [page:.z z], [page:.order order ]]。
</p>
<h3>[method:Vector3 toVector3]( [param:Vector3 optionalResult] )</h3>
<p>
[page:Vector3 optionalResult] — (optional) If specified, the result will be copied into this Vector,
otherwise a new one will be created. <br /><br />
[page:Vector3 optionalResult] — (可选参数) 如果指定了该参数结果将会被复制给该参数,否者会创建一个新的 Vector3 <br /><br />
Returns the Euler's [page:.x x], [page:.y y] and [page:.z z] properties as a [page:Vector3].
以 [page:Vector3] 的形式返回欧拉角的 [page:.x x], [page:.y y] 和 [page:.z z]。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,99 +8,96 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>视锥体([name])</h1>
<p class="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 />
[link:http://en.wikipedia.org/wiki/Frustum Frustums] 用于确定相机视野内的东西。
它有助于加速渲染过程——位于摄像机视锥体外的物体可以安全地排除在渲染之外。<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.
该类主要用于渲染器内部计算 [page:Camera camera] 或 [page:LightShadow.camera shadowCamera]的视锥体。
</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]([param:Plane p0], [param:Plane p1], [param:Plane p2], [param:Plane p3], [param:Plane p4], [param:Plane p5])</h3>
<p>
[page:Plane p0] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p1] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p2] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p3] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p4] - (optional) defaults to a new [page:Plane].<br />
[page:Plane p5] - (optional) defaults to a new [page:Plane].<br /><br />
Creates a new [name].
[page:Plane p0] - (可选参数) [page:Plane].<br />
[page:Plane p1] - (可选参数) [page:Plane].<br />
[page:Plane p2] - (可选参数) [page:Plane].<br />
[page:Plane p3] - (可选参数) [page:Plane].<br />
[page:Plane p4] - (可选参数) [page:Plane].<br />
[page:Plane p5] - (可选参数) [page:Plane].<br /><br />
使用6个面来构建一个视锥体。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Array planes]</h3>
<p>Array of 6 [page:Plane planes].</p>
<p>包含6个平面 [page:Plane planes] 的数组。</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Frustum clone]()</h3>
<p>Return a new Frustum with the same parameters as this one.</p>
<p>返回一个与当前对象有相同参数的视锥体。</p>
<h3>[method:Boolean containsPoint]( [param:Vector3 point] )</h3>
<p>
[page:Vector3 point] - [page:Vector3] to test.<br /><br />
Checks to see if the frustum contains the [page:Vector3 point].
检测该点 [page:Vector3 point] 是否在视锥体内。
</p>
<h3>[method:Frustum copy]( [param:Frustum frustum] )</h3>
<p>
[page:Frustum frustum] - The frustum to copy<br /><br />
[page:Frustum frustum] - 用于拷贝的视锥体。<br /><br />
Copies the properties of the passed [page:Frustum frustum] into this one.
将传入 [page:Frustum frustum] 的属性拷贝到当前对象。
</p>
<h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - [page:Box3] to check for intersection.<br /><br />
Return true if [page:Box3 box] intersects with this frustum.
[page:Box3 box] - [page:Box3] 用于检测是否要交的包围盒。<br /><br />
返回 true 如果该 [page:Box3 box] 与视锥体相交。
</p>
<h3>[method:Boolean intersectsObject]( [param:Object3D object] )</h3>
<p>
Checks whether the [page:Object3D object]'s [page:Geometry.boundingSphere bounding sphere] is intersecting the Frustum.<br /><br />
检测 [page:Object3D object] 的包围球 [page:Geometry.boundingSphere bounding sphere] 是否与视锥体相交。<br /><br />
Note that the object must have a [page:Geometry] or [page:BufferGeometry] so that the bounding sphere
can be calculated.
注意:该对象必须有一个 [page:Geometry] 或 [page:BufferGeometry] ,因为这样才能计算出包围球。
</p>
<h3>[method:Boolean intersectsSphere]( [param:Sphere sphere] )</h3>
<p>
[page:Sphere sphere] - [page:Sphere] to check for intersection.<br /><br />
[page:Sphere sphere] - [page:Sphere] 用于检查是否相交。<br /><br />
Return true if [page:Sphere sphere] intersects with this frustum.
返回true 如果球[page:Sphere sphere]与视锥体相交。
</p>
<h3>[method:Boolean intersectsSprite]( [param:Sprite sprite] )</h3>
<p>
Checks whether the [page:Sprite sprite] is intersecting the Frustum.<br /><br />
检查精灵[page:Sprite sprite]是否与截锥体相交。<br /><br />
</p>
<h3>[method:Frustum set]( [param:Plane p0], [param:Plane p1], [param:Plane p2], [param:Plane p3], [param:Plane p4], [param:Plane p5] )</h3>
<p>
Sets the current frustum from the passed planes. No plane order is implicitely implied.
使用传入的平面设置当前视锥体。没有隐式的顺序。
</p>
<h3>[method:Frustum setFromMatrix]( [param:Matrix4 matrix] )</h3>
<p>
[page:Matrix4 matrix] - [page:Matrix4] used to set the [page:.planes planes]<br /><br />
[page:Matrix4 matrix] - [page:Matrix4] 用于设置 [page:.planes planes]<br /><br />
This is used by the [page:WebGLRenderer] to set up the Frustum from a [page:Camera Camera]'s
[page:Camera.projectionMatrix projectionMatrix] and [page:Camera.matrixWorldInverse matrixWorldInverse].
</p>
[page:WebGLRenderer] 使用 [page:Camera Camera]的投影矩阵([page:Camera.projectionMatrix projectionMatrix] )
和相机世界变换矩阵的逆矩阵 [page:Camera.matrixWorldInverse matrixWorldInverse] 来设置视锥体。
</p>
......
......@@ -8,21 +8,20 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>插值器([name])</h1>
<p class="desc">
Abstract base class of interpolants over parametric samples.<br /><br />
A参数样本上插值的抽象基类 <br /><br />
The parameter domain is one dimensional, typically the time or a path along a curve defined by the data.<br /><br />
参数域是一维的,通常是数据定义的曲线上的时间或路径。<br /><br />
The sample values can have any dimensionality and derived classes may apply special interpretations to the data.<br /><br />
示例值可以具有任何维度,派生类可以对数据应用特殊的解释。<br /><br />
This class provides the interval seek in a Template Method, deferring the actual interpolation to derived classes.<br /><br />
该类提供间隔查找的模板方法,将实际的插值延迟到派生类。<br /><br />
Time complexity is *O(1)* for linear access crossing at most two points and *O(log N)* for random access,
where *N* is the number of positions.<br /><br />
对于最多两个点之间的访问时间复杂度为O(1),对于随机访问时间复杂度为O(log N),其中N为位置数。<br /><br />
References: [link:http://www.oodesign.com/template-method-pattern.html http://www.oodesign.com/template-method-pattern.html]
相关: [link:http://www.oodesign.com/template-method-pattern.html http://www.oodesign.com/template-method-pattern.html]
</p>
......@@ -38,7 +37,7 @@
sampleSize -- number of samples<br />
resultBuffer -- buffer to store the interpolation results.<br /><br />
Note: This is not designed to be called directly.
注意: 这不是设计为直接调用的。
</p>
<h2>Properties</h2>
......@@ -74,10 +73,10 @@
<h3>[method:null evaluate]( [param:Number t] )</h3>
<p>
Evaluate the interpolant at position *t*.
计算补间函数在位置 *t* 的值。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,79 +8,75 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>三维几何线段([name])</h1>
<p class="desc">A geometric line segment represented by a start and end point.</p>
<p class="desc">用起点和终点表示的几何线段。</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Vector3 start], [param:Vector3 end] )</h3>
<p>
[page:Vector3 start] - Start of the line segment. Default is (0, 0, 0).<br />
[page:Vector3 end] - End of the line segment. Default is (0, 0, 0).<br /><br />
[page:Vector3 start] - 线段的起始点。默认值为 (0, 0, 0)。<br />
[page:Vector3 end] - 线段的终点。默认值为 (0, 0, 0)。<br /><br />
Creates a new [name].
创建一个三维几何线段 [name]。
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Vector3 start]</h3>
<p>[page:Vector3] representing the start point of the line.</p>
<p>[page:Vector3] 表示线段的起点。</p>
<h3>[property:Vector3 end]</h3>
<p>[page:Vector3] representing the end point of the line.</p>
<p>[page:Vector3] 表示线段的终点</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Line3 applyMatrix4]( [param:Matrix4 matrix] )</h3>
<p>Applies a matrix transform to the line segment.</p>
<p>对此线段应用矩阵变换。</p>
<h3>[method:Vector3 at]( [param:Float t], [param:Vector3 target] )</h3>
<p>
[page:Float t] - Use values 0-1 to return a position along the line segment. <br />
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
Returns a vector at a certain position along the line. When [page:Float t] = 0, it returns the start vector,
and when [page:Float t] = 1 it returns the end vector.<br />
[page:Float t] - 使用值0-1返回沿线段的位置。<br />
[page:Vector3 target] — 计算结果会被拷贝到target。<br /><br />
返回一个线段某一位置的向量,当 [page:Float t] = 0的时候返回起始点,当[page:Float t] = 1的时候返回终点。<br />
</p>
<h3>[method:Line3 clone]()</h3>
<p>Returns a new [page:Line3] with the same [page:.start start] and [page:.end end] vectors as this one.</p>
<p>返回一个与此线段拥有相同起始点 [page:.start start] 和 终点[page:.end end] 的线段。</p>
<h3>[method:Vector3 closestPointToPoint]( [param:Vector3 point], [param:Boolean clampToLine], [param:Vector3 target] )</h3>
<p>
[page:Vector3 point] - return the closest point on the line to this point.<br />
[page:Boolean clampToLine] - whether to clamp the returned value to the line segment.<br />
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 point] - 用于计算线段上到该点最近的点。<br />
[page:Boolean clampToLine] - 是否将结果限制在线段起始点和终点之间。<br />
[page:Vector3 target] — 结果会拷贝到target。<br /><br />
Returns the closets point on the line. If [page:Boolean clampToLine] is true, then the returned value will be
clamped to the line segment.
返回线段上到point最近的点。如果参数 [page:Boolean clampToLine] 为true。返回值将会在线段之间。
</p>
<h3>[method:Float closestPointToPointParameter]( [param:Vector3 point], [param:Boolean clampToLine] )</h3>
<p>
[page:Vector3 point] - the point for which to return a point parameter. <br />
[page:Boolean clampToLine] - Whether to clamp the result to the range [0, 1].<br /><br />
[page:Vector3 point] - 用于计算返回值的点 <br />
[page:Boolean clampToLine] - 结果是否处于 [0, 1]之间。<br /><br />
Returns a point parameter based on the closest point as projected on the line segement.
If [page:Boolean clampToLine] is true, then the returned value will be between 0 and 1.
返回一个基于点投影到线段上的点的参数。如果 [page:Boolean clampToLine] 为true则返回值将在0到1之间。
</p>
<h3>[method:Line3 copy]( [param:Line3 line] )</h3>
<p>Copies the passed line's [page:.start start] and [page:.end end] vectors to this line.</p>
<p>拷贝传入线段的起始点 [page:.start start] 和终点 [page:.end end] 向量到当前线段。</p>
<h3>[method:Vector3 delta]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
Returns the delta vector of the line segment ( [page:.end end] vector minus the [page:.start start] vector).
[page:Vector3 target] — 结果将会拷贝到target。<br /><br />
返回线段的向量。(终点[page:.end end]向量减去起始点[page:.start start]向量)。
</p>
<h3>[method:Float distance]()</h3>
......@@ -89,34 +85,32 @@
<h3>[method:Float distanceSq]()</h3>
<p>
Returns the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
(straight-line distance) between the line's [page:.start start]
and [page:.end end] vectors.
返回起始点[page:.start start]和终点[page:.end end]的欧几里得距离[link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]。(直线距离)
</p>
<h3>[method:Boolean equals]( [param:Line3 line] )</h3>
<p>
[page:Line3 line] - [page:Line3] to compare with this one.<br /><br />
Returns true if both line's [page:.start start] and [page:.end en] points are equal.
如果给定线段与当前线段的起始点[page:.start start]和终点[page:.end end]都相同则返回true。
</p>
<h3>[method:Vector3 getCenter]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 target] — 结果会写入target。<br /><br />
Returns the center of the line segment.
返回线段的中心点。
</p>
<h3>[method:Line3 set]( [param:Vector3 start], [param:Vector3 end] )</h3>
<p>
[page:Vector3 start] - set the [page:.start start point] of the line.<br />
[page:Vector3 end] - set the [page:.end end point] of the line.<br /><br />
[page:Vector3 start] - 设置线段的起点 [page:.start start point]。<br />
[page:Vector3 end] - 设置线段的终点 [page:.end end point]。<br /><br />
Sets the start and end values by copying the provided vectors.
将传入的向量设置到线段的起始点和终点。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,101 +8,96 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>数学函数([name])</h1>
<p class="desc">An object with several math utility functions.</p>
<p class="desc">具有多个数学实用函数的对象。</p>
<h2>Functions</h2>
<h2>函数(Functions)</h2>
<h3>[method:Float clamp]( [param:Float value], [param:Float min], [param:Float max] )</h3>
<p>
[page:Float value] — Value to be clamped.<br />
[page:Float min] — Minimum value.<br />
[page:Float max] — Maximum value.<br /><br />
[page:Float value] — 需要clamp处理的值。<br />
[page:Float min] — 最小值。<br />
[page:Float max] — 最大值。<br /><br />
Clamps the [page:Float value] to be between [page:Float min] and [page:Float max].
限制数值[page:Float value]处于最小值[page:Float min]和最大值[page:Float max]之间。
</p>
<h3>[method:Float degToRad]( [param:Float degrees] )</h3>
<p>Converts degrees to radians.</p>
<p>将度转化为弧度。</p>
<h3>[method:Integer euclideanModulo]( [param:Integer n], [param:Integer m] )</h3>
<p>
[page:Integer n], [page:Integer m] - Integers<br /><br />
Computes the Euclidean modulo of [page:Integer m] % [page:Integer n], that is:
[page:Integer n], [page:Integer m] - 整型<br /><br />
计算 [page:Integer m] % [page:Integer n] 的欧几里得模:
<code>( ( n % m ) + m ) % m</code>
</p>
<h3>[method:UUID generateUUID]( )</h3>
<p>
Generate a [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID]
(universally unique identifier).
创建一个全局唯一标识符 [link:https://en.wikipedia.org/wiki/Universally_unique_identifier UUID]。
</p>
<h3>[method:Boolean isPowerOfTwo]( [param:Number n] )</h3>
<p>Return *true* if [page:Number n] is a power of 2.</p>
<p>如果 [page:Number n] 是2的幂,返回true。</p>
<h3>[method:Float lerp]( [param:Float x], [param:Float y], [param:Float t] )</h3>
<p>
[page:Float x] - Start point. <br />
[page:Float y] - End point. <br />
[page:Float t] - interpolation factor in the closed interval [0, 1].<br><br />
[page:Float x] - 起始点。 <br />
[page:Float y] - 终点。 <br />
[page:Float t] - 封闭区间[0,1]内的插值因子。<br><br />
Returns a value [link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated]
from two known points based on the given interval - [page:Float t] = 0 will return [page:Float x]
and [page:Float t] = 1 will return [page:Float y].
返回给定区间的线性插值[link:https://en.wikipedia.org/wiki/Linear_interpolation linearly interpolated]结果 - [page:Float t] = 0 将会返回 [page:Float x]
如果 [page:Float t] = 1 将会返回 [page:Float y].
</p>
<h3>[method:Float mapLinear]( [param:Float x], [param:Float a1], [param:Float a2], [param:Float b1], [param:Float b2] )</h3>
<p>
[page:Float x] — Value to be mapped.<br />
[page:Float a1] — Minimum value for range A.<br />
[page:Float a2] — Maximum value for range A.<br />
[page:Float b1] — Minimum value for range B.<br />
[page:Float b2] — Maximum value for range B.<br /><br />
[page:Float x] — 用于映射的值。<br />
[page:Float a1] — A区间最小值。<br />
[page:Float a2] — A区间最大值。<br />
[page:Float b1] — B区间最小值。<br />
[page:Float b2] — A区间最大值。<br /><br />
Linear mapping of [page:Float x] from range [[page:Float a1], [page:Float a2]] to range [[page:Float b1], [page:Float b2]].
x从范围[[page:Float a1], [page:Float a2]] 到范围[[page:Float b1], [page:Float b2]]的线性映射。
</p>
<h3>[method:Integer ceilPowerOfTwo]( [param:Number n] )</h3>
<p>Returns the smallest power of 2 that is greater than or equal to [page:Number n].</p>
<p>返回大于等于 [page:Number n] 的2的最小次幂。</p>
<h3>[method:Integer floorPowerOfTwo]( [param:Number n] )</h3>
<p>Returns the largest power of 2 that is less than or equal to [page:Number n].</p>
<p>返回小于等于 [page:Number n] 的2的最大幂。</p>
<h3>[method:Float radToDeg]( [param:Float radians] )</h3>
<p>Converts radians to degrees.</p>
<p>将弧度转换为角度。</p>
<h3>[method:Float randFloat]( [param:Float low], [param:Float high] )</h3>
<p>Random float in the interval [page:Float low] to [page:Float high].</p>
<p>在区间[page:Float low] 到 [page:Float high]随机一个浮点数。</p>
<h3>[method:Float randFloatSpread]( [param:Float range] )</h3>
<p>Random float in the interval *- [page:Float range] / 2* to *[page:Float range] / 2*.</p>
<p>在区间*- [page:Float range] / 2* 到 *[page:Float range] / 2*随机一个浮点数。</p>
<h3>[method:Integer randInt]( [param:Integer low], [param:Integer high] )</h3>
<p>Random integer in the interval [page:Float low] to [page:Float high].</p>
<p>在区间[page:Float low] 到 [page:Float high]随机一个整数。</p>
<h3>[method:Float smoothstep]( [param:Float x], [param:Float min], [param:Float max] )</h3>
<p>
[page:Float x] - The value to evaluate based on its position between min and max. <br />
[page:Float min] - Any x value below min will be 0.<br />
[page:Float max] - Any x value above max will be 1.<br /><br />
[page:Float x] - 根据其在最小值和最大值之间的位置来计算的值。 <br />
[page:Float min] - 任何x比最小值还小会返回0.<br />
[page:Float max] - 任何x比最大值还大会返回0.<br /><br />
Returns a value between 0-1 that represents the percentage that x has moved between min and max,
but smoothed or slowed down the closer X is to the min and max.<br/><br/>
返回0-1之间的值,该值表示x在最小值和最大值之间移动的百分比,但是当x接近最小值和最大值时,变化程度会平滑或减慢。<br/><br/>
See [link:http://en.wikipedia.org/wiki/Smoothstep Smoothstep] for details.
查看更多详情请移步到 [link:http://en.wikipedia.org/wiki/Smoothstep Smoothstep] 。
</p>
<h3>[method:Float smootherstep]( [param:Float x], [param:Float min], [param:Float max] )</h3>
<p>
[page:Float x] - The value to evaluate based on its position between min and max. <br />
[page:Float min] - Any x value below min will be 0.<br />
[page:Float max] - Any x value above max will be 1.<br /><br />
[page:Float x] - 根据其在最小值和最大值之间的位置来计算的值。 <br />
[page:Float min] - 任何x比最小值还小会返回0.<br />
[page:Float max] - 任何x比最大值还大会返回0.<br /><br />
Returns a value between 0-1. A [link:https://en.wikipedia.org/wiki/Smoothstep#Variations variation on smoothstep]
that has zero 1st and 2nd order derivatives at x=0 and x=1.
返回一个0-1之间的值。它和smoothstep相同,但变动更平缓。[link:https://en.wikipedia.org/wiki/Smoothstep#Variations variation on smoothstep] 在x=0和x=1处有0阶和二阶导数。
</p>
<h2>Source</h2>
......
......@@ -8,38 +8,37 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>三维矩阵([name])</h1>
<p class="desc">
A class representing a 3x3 [link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix].
一个表示3X3矩阵[link:https://en.wikipedia.org/wiki/Matrix_(mathematics) matrix].的类。
</p>
<h2>Example</h2>
<h2>示例(Example)</h2>
<code>
var m = new Matrix3();
</code>
<h2>A Note on Row-Major and Column-Major Ordering</h2>
<h2>注意行优先列优先的顺序。</h2>
<p>
The [page:set]() method takes arguments in [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major]
order, while internally they are stored in the [page:.elements elements] array in column-major order.<br /><br />
[page:set]()方法参数采用行优先[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order row-major],
而它们在内部是用列优先[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major]顺序存储在数组当中。<br /><br />
This means that calling
这意味着
<code>
m.set( 11, 12, 13,
21, 22, 23,
31, 32, 33 );
</code>
will result in the [page:.elements elements] array containing:
元素数组[page:.elements elements]将存储为:
<code>
m.elements = [ 11, 21, 31,
12, 22, 32,
13, 23, 33 ];
</code>
and internally all calculations are performed using column-major ordering. However, as the actual ordering
makes no difference mathematically and most people are used to thinking about matrices in row-major order,
the three.js documentation shows matrices in row-major order. Just bear in mind that if you are reading the source
code, you'll have to take the [link:https://en.wikipedia.org/wiki/Transpose transpose] of any matrices outlined here to make sense of the calculations.
在内部,所有的计算都是使用列优先顺序进行的。然而,由于实际的排序在数学上没有什么不同,
而且大多数人习惯于以行优先顺序考虑矩阵,所以three.js文档以行为主的顺序显示矩阵。
请记住,如果您正在阅读源代码,您必须对这里列出的任何矩阵进行转置[link:https://en.wikipedia.org/wiki/Transpose transpose],以理解计算。
</p>
<h2>Constructor</h2>
......@@ -47,87 +46,81 @@ m.elements = [ 11, 21, 31,
<h3>[name]()</h3>
<p>
Creates and initializes the [name] to the 3x3
[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
创建并初始化一个3X3的单位矩阵[link:https://en.wikipedia.org/wiki/Identity_matrix identity matrix].
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Float32Array elements]</h3>
<p>
A [link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major]
list of matrix values.
矩阵列优先[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order column-major]列表。
</p>
<h3>[property:Boolean isMatrix3]</h3>
<p>
Used to check whether this or derived classes are Matrix3s. Default is *true*.<br /><br />
You should not change this, as it used internally for optimisation.
用于判定此对象或者此类的派生对象是否是三维矩阵。默认值为 *true*。<br /><br />
不应该改变该值,因为它在内部用于优化。
</p>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Array applyToBufferAttribute]( [param:BufferAttribute attribute] )</h3>
<p>
[page:BufferAttribute attribute] - An attribute of floats that represent 3D vectors.<br /><br />
[page:BufferAttribute attribute] - 表示三维向量缓存属性。<br /><br />
Multiplies (applies) this matrix to every 3D vector in the [page:BufferAttribute attribute].
用这个矩阵乘以缓存属性[page:BufferAttribute attribute]里的所有3d向量。
</p>
<h3>[method:Matrix3 clone]()</h3>
<p>Creates a new Matrix3 and with identical elements to this one.</p>
<p>创建一个新的矩阵,元素 [page:.elements elements] 与该矩阵相同。</p>
<h3>[method:this copy]( [param:Matrix3 m] )</h3>
<p>Copies the elements of matrix [page:Matrix3 m] into this matrix.</p>
<p>将矩阵[page:Matrix3 m]的元素复制到当前矩阵中。</p>
<h3>[method:Float determinant]()</h3>
<p>
Computes and returns the
[link:https://en.wikipedia.org/wiki/Determinant determinant] of this matrix.
计算并返回矩阵的行列式[link:https://en.wikipedia.org/wiki/Determinant determinant] 。
</p>
<h3>[method:Boolean equals]( [param:Matrix3 m] )</h3>
<p>Return true if this matrix and [page:Matrix3 m] are equal.</p>
<p>如果矩阵[page:Matrix3 m] 与当前矩阵所有对应元素相同则返回true。</p>
<h3>[method:this fromArray]( [param:Array array], [param:Integer offset] )</h3>
<p>
[page:Array array] - the array to read the elements from.<br />
[page:Integer offset] - (optional) index of first element in the array. Default is 0.<br /><br />
[page:Array array] - 用来存储设置元素数据的数组<br />
[page:Integer offset] - (可选参数) 数组的偏移量,默认值为 0。<br /><br />
Sets the elements of this matrix based on an array in
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
使用基于列优先格式[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major]的数组来设置该矩阵。
</p>
<h3>[method:this getInverse]( [param:Matrix3 m], [param:Boolean throwOnDegenerate] )</h3>
<p>
[page:Matrix3 m] - the matrix to take the inverse of.<br />
[page:Boolean throwOnDegenerate] - (optional) If true, throw an error if the matrix is degenerate (not invertible).<br /><br />
Set this matrix to the [link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] of the passed matrix [page:Matrix3 m],
using the [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method].
If [page:Boolean throwOnDegenerate] is not set and the matrix is not invertible, set this to the 3x3 identity matrix.
[page:Matrix3 m] - 取逆的矩阵。<br />
[page:Boolean throwOnDegenerate] - (optional) 如果设置为true,如果矩阵是退化的(如果不可逆的话),则会抛出一个错误。<br /><br />
使用逆矩阵计算方法[link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method],
将当前矩阵设置为给定矩阵的逆矩阵[link:https://en.wikipedia.org/wiki/Invertible_matrix inverse],如果[page:Boolean throwOnDegenerate]
参数没有设置且给定矩阵不可逆,那么将当前矩阵设置为3X3单位矩阵。
</p>
<h3>[method:this getNormalMatrix]( [param:Matrix4 m] )</h3>
<p>
[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]
of the matrix [page:Matrix4 m].
将这个矩阵设置为给定矩阵的正规矩阵[link:https://en.wikipedia.org/wiki/Normal_matrix normal matrix](左上角的3x3)。
正规矩阵是矩阵[page:Matrix4 m]的逆矩阵[link:https://en.wikipedia.org/wiki/Invertible_matrix inverse] 的转置[link:https://en.wikipedia.org/wiki/Transpose transpose]。
</p>
<h3>[method:this identity]()</h3>
<p>
Resets this matrix to the 3x3 identity matrix:
<code>
将此矩阵重置为3x3单位矩阵:
<code>
1, 0, 0
0, 1, 0
0, 0, 1
......@@ -136,22 +129,22 @@ m.elements = [ 11, 21, 31,
</p>
<h3>[method:this multiply]( [param:Matrix3 m] )</h3>
<p>Post-multiplies this matrix by [page:Matrix3 m].</p>
<p>将当前矩阵乘以矩阵[page:Matrix3 m]。</p>
<h3>[method:this multiplyMatrices]( [param:Matrix3 a], [param:Matrix3 b] )</h3>
<p>Sets this matrix to [page:Matrix3 a] x [page:Matrix3 b].</p>
<p>设置当前矩阵为矩阵[page:Matrix3 a] x 矩阵[page:Matrix3 b]。</p>
<h3>[method:this multiplyScalar]( [param:Float s] )</h3>
<p>Multiplies every component of the matrix by the scalar value *s*.</p>
<p>当前矩阵所有的元素乘以该缩放值*s*</p>
<h3>[method:this set]( [param:Float n11], [param:Float n12], [param:Float n13], [param:Float n21], [param:Float n22], [param:Float n23], [param:Float n31], [param:Float n32], [param:Float n33] )</h3>
<p>
[page:Float n11] - value to put in row 1, col 1.<br />
[page:Float n12] - value to put in row 1, col 2.<br />
[page:Float n11] - 设置第一行第一列的值。<br />
[page:Float n12] - 设置第一行第二列的值。<br />
...<br />
...<br />
[page:Float n32] - value to put in row 3, col 2.<br />
[page:Float n33] - value to put in row 3, col 3.<br /><br />
[page:Float n32] - 设置第三行第二列的值。<br />
[page:Float n33] - 设置第三行第三列的值。<br /><br />
Sets the 3x3 matrix values to the given
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order row-major]
......@@ -159,45 +152,44 @@ m.elements = [ 11, 21, 31,
</p>
<h3>[method:this premultiply]( [param:Matrix3 m] )</h3>
<p>Pre-multiplies this matrix by [page:Matrix3 m].</p>
<p>将矩阵[page:Matrix3 m]乘以当前矩阵。</p>
<h3>[method:this setFromMatrix4]( [param:Matrix4 m] )</h3>
<p>Set this matrx to the upper 3x3 matrix of the Matrix4 [page:Matrix4 m].</p>
<p>将当前矩阵设置为4X4矩阵[page:Matrix4 m]左上3X3</p>
<h3>[method:this setUvTransform]( [param:Float tx], [param:Float ty], [param:Float sx], [param:Float sy], [param:Float rotation], [param:Float cx], [param:Float cy] )</h3>
<p>
[page:Float tx] - offset x<br />
[page:Float ty] - offset y<br />
[page:Float sx] - repeat x<br />
[page:Float sy] - repeat y<br />
[page:Float rotation] - rotation (in radians)<br />
[page:Float cx] - center x of rotation<br />
[page:Float cy] - center y of rotation<br /><br />
Sets the UV transform matrix from offset, repeat, rotation, and center.
[page:Float tx] - x偏移量<br />
[page:Float ty] - y偏移量<br />
[page:Float sx] - x方向的重复比例<br />
[page:Float sy] - y方向的重复比例<br />
[page:Float rotation] - 旋转(弧度)<br />
[page:Float cx] - 旋转中心x<br />
[page:Float cy] - 旋转中心y<br /><br />
使用偏移,重复,旋转和中心点位置设置UV变换矩阵。
</p>
<h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3>
<p>
[page:Array array] - (optional) array to store the resulting vector in. If not given a new array will be created.<br />
[page:Integer offset] - (optional) offset in the array at which to put the result.<br /><br />
[page:Array array] - (可选参数) 存储矩阵元素的数组,如果未指定会创建一个新的数组。<br />
[page:Integer offset] - (可选参数) 存放矩阵元素数组的偏移量。<br /><br />
Writes the elements of this matrix to an array in
[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major] format.
使用列优先[link:https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order column-major]格式将此矩阵的元素写入数组中。
</p>
<h3>[method:this transpose]()</h3>
<p>[link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix in place.</p>
<p>将该矩阵转置[link:https://en.wikipedia.org/wiki/Transpose Transposes]。</p>
<h3>[method:this transposeIntoArray]( [param:Array array] )</h3>
<p>
[page:Array array] - array to store the resulting vector in.<br /><br />
[page:Array array] - 用于存储当前矩阵转置结果的数组。<br /><br />
[link:https://en.wikipedia.org/wiki/Transpose Transposes] this matrix into the supplied array,
and returns itself unchanged.
将当前矩阵的转置[link:https://en.wikipedia.org/wiki/Transpose Transposes]存入给定的数组[param:Array array]但不改变当前矩阵,
并返回当前矩阵。
</p>
<h2>Source</h2>
<h2>源码(Source)</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
此差异已折叠。
......@@ -8,165 +8,156 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>平面([name])</h1>
<p class="desc">
A two dimensional surface that extends infinitely in 3d space, represented in [link:http://mathworld.wolfram.com/HessianNormalForm.html Hessian normal form]
by a unit length normal vector and a constant.
在三维空间中无限延伸的二维平面,平面方程用单位长度的法向量和常数表示为海塞法向量[link:http://mathworld.wolfram.com/HessianNormalForm.html Hessian normal form]形式。
</p>
<h2>Constructor</h2>
<h2>构造器(Constructor)</h2>
<h3>[name]( [param:Vector3 normal], [param:Float constant] )</h3>
<p>
[page:Vector3 normal] - (optional) a unit length [page:Vector3] defining the normal of the plane. Default is *(1, 0, 0)*.<br />
[page:Float constant] - (optional) the signed distance from the origin to the plane. Default is *0*.
[page:Vector3 normal] - (可选参数) 定义单位长度的平面法向量[page:Vector3]。默认值为 *(1, 0, 0)*。<br />
[page:Float constant] - (可选参数) 从原点到平面的有符号距离。 默认值为 *0*.
</p>
<h2>Properties</h2>
<h2>属性(Properties)</h2>
<h3>[property:Vector3 normal]</h3>
<h3>[property:Float constant]</h3>
<h2>Methods</h2>
<h2>方法(Methods)</h2>
<h3>[method:Plane applyMatrix4]( [param:Matrix4 matrix], [param:Matrix3 optionalNormalMatrix] )</h3>
<p>
[page:Matrix4 matrix] - the [Page:Matrix4] to apply.<br />
[page:Matrix3 optionalNormalMatrix] - (optional) pre-computed normal [Page:Matrix3] of the Matrix4 being applied.<br /><br />
[page:Matrix4 matrix] - 要应用的四位矩阵([Page:Matrix4])。<br />
[page:Matrix3 optionalNormalMatrix] - (可选参数) 预先计算好的上述Matrix4参数的法线矩阵 [Page:Matrix3]。<br /><br />
Apply a Matrix4 to the plane. The matrix must be an affine, homogeneous transform.<br />
If supplying an [page:Matrix3 optionalNormalMatrix], it can be created like so:
在平面上应用矩阵。矩阵必须是仿射齐次变换。<br />
如果提供一个optionalNormalMatrix,可以这样创建:
<code>
var optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix );
</code>
</p>
<h3>[method:Plane clone]()</h3>
<p>Returns a new plane with the same [page:.normal normal] and [page:.constant constant] as this one.</p>
<p>返回一个与当前平面有相同法线 [page:.normal normal],常量 [page:.constant constant] 距离的平面。</p>
<h3>[method:Vector3 coplanarPoint]( [param:Vector3 target] )</h3>
<p>
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 target] — 结果会拷贝到该向量中。<br /><br />
Returns a [page:Vector3] coplanar to the plane, by calculating the projection of the
normal vector at the origin onto the plane.
返回一个共面点,通过原点的法向量在平面上投影算得。
</p>
<h3>[method:Plane copy]( [param:Plane plane] )</h3>
<p>
Copies the values of the passed plane's [page:.normal normal] and [page:.constant constant]
properties to this plane.
拷贝给定平面,将其中的法线 [page:.normal normal],距离常量 [page:.constant constant]属性拷贝给该对象。
</p>
<h3>[method:Float distanceToPoint]( [param:Vector3 point] )</h3>
<p>Returns the signed distance from the [page:Vector3 point] to the plane.</p>
<p>返回点[page:Vector3 point]到平面的有符号距离。</p>
<h3>[method:Float distanceToSphere]( [param:Sphere sphere] )</h3>
<p>Returns the signed distance from the [page:Sphere sphere] to the plane.</p>
<p>返回球面 [page:Sphere sphere] 的边缘到平面的最短距离。</p>
<h3>[method:Boolean equals]( [param:Plane plane] )</h3>
<p>
Checks to see if two planes are equal (their [page:.normal normal] and
[page:.constant constant] properties match).
检查两个平面是否相等。(法线 [page:.normal normal] 以及常量 [page:.constant constant] 都相同)。
</p>
<h3>[method:Vector3 intersectLine]( [param:Line3 line], [param:Vector3 target] )</h3>
<p>
[page:Line3 line] - the [page:Line3] to check for intersection.<br />
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Line3 line] - 检测是否相交的三维几何线段 [page:Line3]。<br />
[page:Vector3 target] — 结果将会写入该向量中。<br /><br />
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.
返回给定线段和平面的交点。如果不相交则返回undefined。如果线与平面共面,则返回该线段的起始点。
</p>
<h3>[method:Boolean intersectsBox]( [param:Box3 box] )</h3>
<p>
[page:Box3 box] - the [page:Box3] to check for intersection.<br /><br />
[page:Box3 box] - 检查是否相交的包围盒 [page:Box3]。<br /><br />
Determines whether or not this plane intersects [page:Box3 box].
确定该平面是否与给定3d包围盒[page:Box3]相交。
</p>
<h3>[method:Boolean intersectsLine]( [param:Line3 line] )</h3>
<p>
[page:Line3 line] - the [page:Line3] to check for intersection.<br /><br />
[page:Line3 line] - 检查是否相交的三维线段 [page:Line3]。<br /><br />
Tests whether a line segment intersects with (passes through) the plane.
测试线段是否与平面相交。
</p>
<h3>[method:Boolean intersectsSphere]( [param:Sphere sphere] )</h3>
<p>
[page:Sphere sphere] - the [page:Sphere] to check for intersection.<br /><br />
[page:Sphere sphere] - 检查是否相交的球体 [page:Sphere]。<br /><br />
Determines whether or not this plane intersects [page:Sphere sphere].
确定该平面是否与给定球体 [page:Sphere] 相交。
</p>
<h3>[method:Plane negate]()</h3>
<p>
Negates both the normal vector and the constant.
将法向量与常量求反(乘以-1)。
</p>
<h3>[method:Plane normalize]()</h3>
<p>
Normalizes the [page:.normal normal] vector, and adjusts the [page:.constant constant]
value accordingly.
归一化法向量 [page:.normal normal] ,并相应的调整常量 [page:.constant constant]数值。
</p>
<h3>[method:Vector3 projectPoint]( [param:Vector3 point], [param:Vector3 target] )</h3>
<p>
[page:Vector3 point] - the [page:Vector3] to project onto the plane.<br />
[page:Vector3 target] — the result will be copied into this Vector3.<br /><br />
[page:Vector3 point] - 需要投射到该平面的点。<br />
[page:Vector3 target] — 在该平面上离投射点最近的点。<br /><br />
Projects a [page:Vector3 point] onto the plane.
将一个点[page:Vector3 point]投射到该平面上。
</p>
<h3>[method:Plane set]( [param:Vector3 normal], [param:Float constant] )</h3>
<p>
[page:Vector3 normal] - a unit length [page:Vector3] defining the normal of the plane.<br />
[page:Float constant] - the signed distance from the origin to the plane. Default is *0*.<br /><br />
[page:Vector3 normal] - 单位长度的向量表示平面的法向量。<br />
[page:Float constant] - 原点到平面有符号距离。默认值为 *0*。<br /><br />
Sets the plane's [page:.normal normal] and [page:.constant constant] properties.
设置平面 [page:.normal normal] 的法线和常量 [page:.constant constant] 属性值。
</p>
<h3>[method:Plane setComponents]( [param:Float x], [param:Float y], [param:Float z], [param:Float w] )</h3>
<p>
[page:Float x] - x value of the unit length normal vector.<br />
[page:Float y] - y value of the unit length normal vector.<br />
[page:Float z] - z value of the unit length normal vector.<br />
[page:Float w] - the value of the plane's [page:.constant constant] property.<br /><br />
[page:Float x] - 单位长度法向量的x值。<br />
[page:Float y] - 单位长度法向量的y值。<br />
[page:Float z] - 单位长度法向量的z值。<br />
[page:Float w] - 原点沿法向量到平面常量 [page:.constant constant] 距离。<br /><br />
Set the individual components that define the plane.
设置定义平面的各个变量。
</p>
<h3>[method:Plane setFromCoplanarPoints]( [param:Vector3 a], [param:Vector3 b], [param:Vector3 c] )</h3>
<p>
[page:Vector3 a] - first point on the plane.<br />
[page:Vector3 b] - second point on the plane.<br />
[page:Vector3 c] - third point on the plane.<br /><br />
[page:Vector3 a] - 用于确定平面的第一个点。<br />
[page:Vector3 b] - 用于确定平面的第二个点。<br />
[page:Vector3 c] - 用于确定平面的第三个点。<br /><br />
Defines the plane based on the 3 provided points. The winding order is assumed to be counter-clockwise,
and determines the direction of the [page:.normal normal].
根据给定的三个点确定平面。如果三个点共线将会抛出错误。通过右手螺旋规则确定(向量叉乘)法向量 [page:.normal normal]。
</p>
<h3>[method:Plane setFromNormalAndCoplanarPoint]( [param:Vector3 normal], [param:Vector3 point] ) [param:Vector3 this]</h3>
<p>
[page:Vector3 normal] - a unit length [page:Vector3] defining the normal of the plane.<br />
[page:Vector3 point] - [page:Vector3]<br /><br />
[page:Vector3 normal] - 平面单位法向量<br />
[page:Vector3 point] - 平面上的点<br /><br />
Sets the plane's properties as defined by a [page:Vector3 normal] and an arbitrary coplanar [page:Vector3 point].
通过平面上的一点以及法线确定原点到平面的最短距离(常量)。
</p>
<h3>[method:Plane translate]( [param:Vector3 offset] )</h3>
<p>
[page:Vector3 offset] - the amount to move the plane by.<br /><br />
[page:Vector3 offset] - 平移量<br /><br />
Translates the plane by the distance defined by the [page:Vector3 offset] vector.
Note that this only affects the plane constant and will not affect the normal vector.
将平面平移给定向量大小,注意:这只会影响平面的常量不会影响平面的法向量。
</p>
<h2>Source</h2>
......
......@@ -38,41 +38,60 @@
<h2>示例</h2>
<code>
var geometry = new THREE.CylinderGeometry( 5, 5, 5, 5, 15, 5, 30 );
var geometry = new THREE.CylinderBufferGeometry( 5, 5, 5, 5, 15, 5, 30 );
//Create the skin indices and skin weights
for ( var i = 0; i < geometry.vertices.length; i ++ ) {
// create the skin indices and skin weights
// Imaginary functions to calculate the indices and weights
// This part will need to be changed depending your skeleton and model
var skinIndex = calculateSkinIndex( geometry.vertices, i );
var skinWeight = calculateSkinWeight( geometry.vertices, i );
var position = geometry.attributes.position;
// Ease between each bone
geometry.skinIndices.push( new THREE.Vector4( skinIndex, skinIndex + 1, 0, 0 ) );
geometry.skinWeights.push( new THREE.Vector4( 1 - skinWeight, skinWeight, 0, 0 ) );
var vertex = new THREE.Vector3();
var skinIndices = [];
var skinWeights = [];
for ( var i = 0; i < position.count; i ++ ) {
vertex.fromBufferAttribute( position, i );
// compute skinIndex and skinWeight based on some configuration data
var y = ( vertex.y + sizing.halfHeight );
var skinIndex = Math.floor( y / sizing.segmentHeight );
var skinWeight = ( y % sizing.segmentHeight ) / sizing.segmentHeight;
skinIndices.push( skinIndex, skinIndex + 1, 0, 0 );
skinWeights.push( 1 - skinWeight, skinWeight, 0, 0 );
}
geometry.addAttribute( 'skinIndex', new THREE.Uint16BufferAttribute( skinIndices, 4 ) );
geometry.addAttribute( 'skinWeight', new THREE.Float32BufferAttribute( skinWeights, 4 ) );
// create skinned mesh and skeleton
var mesh = new THREE.SkinnedMesh( geometry, material );
var skeleton = new THREE.Skeleton( bones );
// see example from THREE.Skeleton
// See example from THREE.Skeleton for the armSkeleton
var rootBone = armSkeleton.bones[ 0 ];
var rootBone = skeleton.bones[ 0 ];
mesh.add( rootBone );
// Bind the skeleton to the mesh
mesh.bind( armSkeleton );
// bind the skeleton to the mesh
mesh.bind( skeleton );
// move the bones and manipulate the model
// Move the bones and manipulate the model
armSkeleton.bones[ 0 ].rotation.x = -0.1;
armSkeleton.bones[ 1 ].rotation.x = 0.2;
skeleton.bones[ 0 ].rotation.x = -0.1;
skeleton.bones[ 1 ].rotation.x = 0.2;
</code>
<h2>构造器</h2>
<h3>[name]( [param:Geometry geometry], [param:Material material] )</h3>
<h3>[name]( [param:BufferGeometry geometry], [param:Material material] )</h3>
<p>
[page:Geometry geometry] —— 一个[page:Geometry]或者[page:BufferGeometry](推荐)的实例。
[page:Geometry.skinIndices skinIndices] 和 [page:Geometry.skinWeights skinWeights] 在几何体上应当被设置为true。<br />
[page:BufferGeometry geometry] —— TODO<br />
[page:Material material] —— (可选)一个[page:Material]的实例,默认值是一个新的[page:MeshBasicMaterial]。
</p>
......@@ -108,7 +127,7 @@
<h3>[property:Skeleton skeleton]</h3>
<p>
[page:Skeleton]是由从构造函数中传入的[page:Geometry]中的[page:Geometry.bones bones]来创建的。
TODO
</p>
......@@ -121,7 +140,6 @@
[page:Skeleton skeleton] —— 由一棵[page:Bone Bones]树创建的[page:Skeleton]。<br/>
[page:Matrix4 bindMatrix] —— 代表着骨架基本变换的[page:Matrix4](4x4矩阵)。<br /><br />
将骨架绑定到一个蒙皮网格上。bindMatrix会被保存到.bindMatrix属性中,其逆矩阵.bindMatrixInverse也会被计算出来。
它在构造函数中会被自动调用,其骨架是由传入到构造函数的[page:Geometry]中的[page:Geometry.bones bones]来创建的。
</p>
<h3>[method:SkinnedMesh clone]()</h3>
......@@ -131,7 +149,7 @@
<h3>[method:null normalizeSkinWeights]()</h3>
<p>
规范化[page:Geometry.skinWeights]矢量。不会对[page:BufferGeometry]产生影响。
TODO
</p>
<h3>[method:null pose]()</h3>
......@@ -144,11 +162,6 @@
更新[page:Matrix4 MatrixWorld]矩阵。
</p>
<h3>[method:null initBones]()</h3>
<p>
从内部几何体中创建一个分层[page:Bone bones]对象的数组。
</p>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -10,67 +10,67 @@
<body>
[page:Texture] &rarr;
<h1>[name]</h1>
<h1>Canvas纹理([name])</h1>
<p class="desc">
Creates a texture from a canvas element.<br /><br />
从Canvas元素中创建纹理贴图。<br /><br />
This is almost the same as the base [page:Texture Texture] class, except that it sets [page:Texture.needsUpdate needsUpdate] to *true* immediately.
它几乎与其基类[page:Texture Texture]相同,但它直接将[page:Texture.needsUpdate needsUpdate](需要更新)设置为了*true*。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:HTMLElement canvas], [param:Constant mapping], [param:Constant wrapS], [param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter], [param:Constant format], [param:Constant type], [param:Number anisotropy] )</h3>
<p>
[page:HTMLElement canvas] -- The HTML canvas element from which to load the texture. <br />
[page:HTMLElement canvas] -- 将会被用于加载纹理贴图的Canvas元素。<br />
[page:Constant mapping] -- How the image is applied to the object. An object type of [page:Textures THREE.UVMapping].
See [page:Textures mapping constants] for other choices.<br />
[page:Constant mapping] -- 纹理贴图将被如何应用(映射)到物体上,它是[page:Textures THREE.UVMapping]中的对象类型。
请参阅[page:Textures mapping constants](映射模式常量)来了解其他选项。<br />
[page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for other choices.<br />
[page:Constant wrapS] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for other choices.<br />
[page:Constant wrapT] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
The default is [page:Textures THREE.LinearFilter]. See [page:Textures magnification filter constants] for other choices.<br />
[page:Constant magFilter] -- 当一个纹素覆盖大于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.LinearFilter]。请参阅[page:Textures magnification filter constants](放大滤镜常量)来了解其它选项。<br />
[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
The default is [page:Textures THREE.LinearMipMapLinearFilter]. See [page:Textures minification filter constants] for other choices.<br />
[page:Constant minFilter] -- 当一个纹素覆盖小于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.LinearMipMapLinearFilter]。请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其它选项。<br />
[page:Constant format] -- The format used in the texture.
See [page:Textures format constants] for other choices.<br />
[page:Constant format] -- 在纹理贴图中使用的格式。
请参阅[page:Textures format constants](格式常量)来了解各个选项。<br />
[page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
See [page:Textures type constants] for other choices.<br />
[page:Constant type] -- 默认值是[page:Textures THREE.UnsignedByteType].
请参阅[page:Textures type constants](类型常量)来了解其他选项。<br />
[page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br /><br />
[page:Number anisotropy] -- 沿着轴,通过具有最高纹素密度的像素的样本数。
默认情况下,这个值为1。设置一个较高的值将会产生比基本的mipmap更清晰的效果,代价是需要使用更多纹理样本。
使用[page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() 来查询GPU中各向异性的最大有效值;这个值通常是2的幂。<br /><br />
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p>
See the base [page:Texture Texture] class for common properties.
请参阅其基类[page:Texture Texture]来了解共有属性。
</p>
<h3>[property:boolean needsUpdate]</h3>
<p>
True by default. This is required so that the canvas data is loaded.
默认值为true,这是必须的,以便使得Canvas中的数据能够载入。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p>
See the base [page:Texture Texture] class for common methods.
请参阅[page:Texture Texture]来了解共有方法。
</p>
<h2>Source</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -10,78 +10,78 @@
<body>
[page:Texture] &rarr;
<h1>[name]</h1>
<h1>压缩的纹理([name])</h1>
<p class="desc">
Creates a texture based on data in compressed form, for example from a [link:https://en.wikipedia.org/wiki/DirectDraw_Surface DDS] file.<br /><br />
基于被压缩的数据,创建一个纹理贴图,例如从一个[link:https://en.wikipedia.org/wiki/DirectDraw_Surface DDS]文件中。<br /><br />
For use with the [page:CompressedTextureLoader CompressedTextureLoader].
它和[page:CompressedTextureLoader CompressedTextureLoader]一起使用。
</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Array mipmaps], [param:Number width], [param:Number height], [param:Constant format], [param:Constant type], [param:Constant mapping], [param:Constant wrapS], [param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter], [param:Number anisotropy] )</h3>
<p>
[page:Array mipmaps] -- The mipmaps array should contain objects with data, width and height. The mipmaps should be of the correct format and type.<br />
[page:Array mipmaps] -- mipmaps数组中需要包含具有数据、宽、高的对象。mipmaps应当具有正确的格式与类型。<br />
[page:Number width] -- The width of the biggest mipmap.<br />
[page:Number width] -- 最大的mipmap的宽。<br />
[page:Number height] -- The height of the biggest mipmap.<br />
[page:Number height] -- 最大的mipmap的高。<br />
[page:Constant format] -- The format used in the mipmaps.
See [page:Textures ST3C Compressed Texture Formats],
[page:Textures PVRTC Compressed Texture Formats] and
[page:Textures ETC Compressed Texture Format] for other choices.<br />
[page:Constant format] -- 在mipmaps中使用的格式。
请参阅[page:Textures ST3C Compressed Texture Formats]、
[page:Textures PVRTC Compressed Texture Formats]
[page:Textures ETC Compressed Texture Format]页面来了解其它选项。<br />
[page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
See [page:Textures type constants] for other choices.<br />
[page:Constant type] -- 默认值是[page:Textures THREE.UnsignedByteType]。
请参阅[page:Textures type constants]页面来了解其它选项。<br />
[page:Constant mapping] -- How the image is applied to the object. An object type of [page:Textures THREE.UVMapping].
See [page:Textures mapping constants] for other choices.<br />
[page:Constant mapping] -- 纹理贴图将被如何应用(映射)到物体上,它是[page:Textures THREE.UVMapping]中的对象类型。
请参阅[page:Textures mapping constants](映射模式常量)来了解其他选项。<br />
[page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for other choices.<br />
[page:Constant wrapS] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for other choices.<br />
[page:Constant wrapT] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
The default is [page:Textures THREE.LinearFilter]. See [page:Textures magnification filter constants] for other choices.<br />
[page:Constant magFilter] -- 当一个纹素覆盖大于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.LinearFilter]。请参阅[page:Textures magnification filter constants](放大滤镜常量)来了解其它选项。<br />
[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
The default is [page:Textures THREE.LinearMipMapLinearFilter]. See [page:Textures minification filter constants] for other choices.<br />
[page:Constant minFilter] -- 当一个纹素覆盖小于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.LinearMipMapLinearFilter]。请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其它选项。<br />
[page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
Use renderer.getMaxAnisotropy() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br /><br />
[page:Number anisotropy] -- 沿着轴,通过具有最高纹素密度的像素的样本数。
默认情况下,这个值为1。设置一个较高的值将会产生比基本的mipmap更清晰的效果,代价是需要使用更多纹理样本。
使用[page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() 来查询GPU中各向异性的最大有效值;这个值通常是2的幂。<br /><br />
</p>
<h2>Properties</h2>
<h2>属性</h2>
See the base [page:Texture Texture] class for common properties.
请参阅其基类[page:Texture Texture]来了解共有属性。
<h3>[property:boolean flipY]</h3>
<p>
False by default. Flipping textures does not work for compressed textures.
默认值为false。翻转纹理在压缩的纹理贴图中无法工作。
</p>
<h3>[property:boolean generateMipmaps]</h3>
<p>
False by default. Mipmaps can't be generated for compressed textures
默认值为false。无法为压缩的纹理贴图生成Mipmap。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h2>Source</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -10,11 +10,11 @@
<body>
[page:Texture] &rarr;
<h1>[name]</h1>
<h1>立方纹理([name])</h1>
<p class="desc">Creates a cube texture made up of six images.</p>
<p class="desc">创建一个由6张图片所组成的纹理对象。</p>
<h2>Example</h2>
<h2>示例</h2>
<code>
var loader = new THREE.CubeTextureLoader();
......@@ -29,28 +29,27 @@
var material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } );
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy )</h3>
<p>
CubeTexture is almost equivalent in functionality and usage to [page:Texture]. The only differences are that the
images are an array of 6 images as opposed to a single image, and the mapping options are
[page:Textures THREE.CubeReflectionMapping] (default) or [page:Textures THREE.CubeRefractionMapping]
CubeTexture(立方贴图)的功能以及用法几乎和[page:Texture]是相同的。区别在于,CubeTexture中的图像是6个单独的图像所组成的数组,
纹理映射选项为[page:Textures THREE.CubeReflectionMapping](默认值)或[page:Textures THREE.CubeRefractionMapping]。
</p>
<h2>Properties</h2>
<h2>属性</h2>
<h3>See [page:Texture]</h3>
<h3>请参阅[page:Texture]页面。</h3>
<h2>Methods</h2>
<h2>方法</h2>
<h3>See [page:Texture]</h3>
<h3>请参阅[page:Texture]页面。</h3>
<h2>Source</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -12,39 +12,39 @@
<h1>[name]</h1>
<p class="desc">Creates a three-dimensional texture. This type of texture can only be used with a WebGL 2 rendering context.</p>
<p class="desc">创建一个三维的纹理贴图。这种纹理贴图只能被用于WebGL 2渲染环境中。</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:TypedArray data], [param:Number width], [param:Number height], [param:Number depth] )</h3>
<p>
[page:Object data] -- data of the texture.<br />
[page:Object data] -- 纹理的数据。<br />
[page:Number width] -- width of the texture.<br />
[page:Number width] -- 纹理的宽度。<br />
[page:Number height] -- height of the texture.<br />
[page:Number height] -- 纹理的高度。<br />
[page:Number depth] -- depth of the texture.
[page:Number depth] -- 纹理的深度。
</p>
<h2>Example</h2>
<h2>示例</h2>
<div>[example:webgl2_materials_texture3d WebGL2 / materials / texture3d]</div>
<div>[example:webgl2_materials_texture3d_volume WebGL2 / materials / texture3d / volume]</div>
<h2>Properties</h2>
<h2>属性</h2>
<p>
See the base [page:Texture Texture] class for common properties.
请参阅其基类[page:Texture Texture]来了解共有属性。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p>
See the base [page:Texture Texture] class for common methods.
请参阅其基类[page:Texture Texture]来了解共有方法。
</p>
<h2>Source</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -10,103 +10,102 @@
<body>
[page:Texture] &rarr;
<h1>[name]</h1>
<h1>深度纹理([name])</h1>
<p class="desc">
Creates a texture for use as a Depth Texture. Require support for the
[link:https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ WEBGL_depth_texture] extension.
创建一个作为深度纹理贴图来使用的纹理。需要支持[link:https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/ WEBGL_depth_texture]扩展。
</p>
<h2>Example</h2>
<h2>示例</h2>
[example:webgl_depth_texture depth / texture]
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Number width], [param:Number height], [param:Constant type], [param:Constant wrapS], [param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter], [param:Number anisotropy], [param:Constant format] )</h3>
<p>
[page:Number width] -- width of the texture.<br />
[page:Number width] -- 纹理的宽度。<br />
[page:Number height] -- height of the texture.<br />
[page:Number height] -- 纹理的高度。<br />
[page:Constant type] -- Default is [page:Textures THREE.UnsignedShortType].
See [page:Textures type constants] for other choices.<br />
[page:Constant type] -- 默认值是[page:Textures THREE.UnsignedShortType]。
请参阅[page:Textures type constants](类型常量)来了解其他选项。<br />
[page:Constant mapping] --
See [page:Textures type constants] for details.<br />
请参阅[page:Textures mapping constants](映射模式常量)来了解其他选项。<br />
[page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for other choices.<br />
[page:Constant wrapS] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for other choices.<br />
[page:Constant wrapT] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
The default is [page:Textures THREE.NearestFilter]. See [page:Textures magnification filter constants] for other choices.<br />
[page:Constant magFilter] -- 当一个纹素覆盖大于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.LinearFilter]。请参阅[page:Textures magnification filter constants](放大滤镜常量)来了解其它选项。<br />
[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
The default is [page:Textures THREE.NearestFilter]. See [page:Textures minification filter constants] for other choices.<br />
[page:Constant minFilter] -- 当一个纹素覆盖小于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.LinearMipMapLinearFilter]。请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其它选项。<br />
[page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br />
[page:Number anisotropy] -- 沿着轴,通过具有最高纹素密度的像素的样本数。
默认情况下,这个值为1。设置一个较高的值将会产生比基本的mipmap更清晰的效果,代价是需要使用更多纹理样本。
使用[page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() 来查询GPU中各向异性的最大有效值;这个值通常是2的幂。<br /><br />
[page:Constant format] -- must be either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
See [page:Textures format constants] for details.<br />
[page:Constant format] -- 这个值必须是[page:Textures DepthFormat](默认值)或者[page:Textures DepthStencilFormat]。
请参阅[page:Textures format constants](格式常量)来了解详细信息。<br />
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p>
See the base [page:Texture Texture] class for common properties
- the following are also part of the texture class, but have different defaults here.
请参阅其基类[page:Texture Texture]来了解共有属性。
—— 以下属性也是texture类中的一部分,但在这里默认值不同。
</p>
<h3>[page:Texture.format .format]</h3>
<p>
Either [page:Textures DepthFormat] (default) or [page:Textures DepthStencilFormat].
See [page:Textures format constants] for details.<br />
[page:Textures DepthFormat](默认值)或者[page:Textures DepthStencilFormat]中的一个。
请参阅[page:Textures format constants]来了解详细信息。<br />
</p>
<h3>[page:Texture.type .type]</h3>
<p>
Default is [page:Textures THREE.UnsignedShortType].
See [page:Textures format constants] for details.<br />
默认值是[page:Textures THREE.UnsignedShortType]。
请参阅[page:Textures format constants]来了解详细信息。<br />
</p>
<h3>[page:Texture.magFilter .magFilter]</h3>
<p>
How the texture is sampled when a texel covers more than one pixel.
The default is [page:Textures THREE.NearestFilter].
See [page:Textures magnification filter constants] for other choices.
当一个纹素覆盖大于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.NearestFilter]。
请参阅[page:Textures magnification filter constants](放大滤镜常量)来了解其他选项。
</p>
<h3>[page:Texture.minFilter .minFilter]</h3>
<p>
How the texture is sampled when a texel covers less than one pixel.
The default is [page:Textures THREE.NearestFilter].
See [page:Textures magnification filter constants] for other choices.
当一个纹素覆盖小于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.NearestFilter]。
请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其他选项。
</p>
<h3>[page:Texture.flipY .flipY]</h3>
<p>
Depth textures do not need to be flipped so this is *false* by default.
深度贴图不需要被翻转,因此其默认值为*false*。
</p>
<h3>[page:Texture.generateMipmaps .generateMipmaps]</h3>
<p>
Depth textures do not use mipmaps.
深度贴图不使用mipmap。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p>
See the base [page:Texture Texture] class for common methods.
请参阅其基类[page:Texture Texture]来了解共有方法。
</p>
<h2>Source</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -8,16 +8,16 @@
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h1>纹理([name])</h1>
<p class="desc">Create a texture to apply to a surface or as a reflection or refraction map.</p>
<p class="desc">创建一个纹理贴图,将其应用到一个表面,或者作为反射/折射贴图。</p>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( image, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding )</h3>
<h2>Example</h2>
<h2>源代码</h2>
<code>
// load a texture, set wrap mode to repeat
......@@ -27,236 +27,233 @@
texture.repeat.set( 4, 4 );
</code>
<h2>Properties</h2>
<h2>属性</h2>
<h3>[property:Integer id]</h3>
<p>
Readonly - unique number for this texture instance.
只读 - 表示该纹理实例的唯一数字。
</p>
<h3>[property:String uuid]</h3>
<p>
[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID] of this object instance.
This gets automatically assigned, so this shouldn't be edited.
该对象实例的[link:http://en.wikipedia.org/wiki/Universally_unique_identifier UUID]。
这个值是自动分配的,因此不应当对其进行编辑。
</p>
<h3>[property:String name]</h3>
<p>
Optional name of the object (doesn't need to be unique). Default is an empty string.
该对象的名称,可选,且无需唯一。默认值是一个空字符串。
</p>
<h3>[property:Image image]</h3>
<p>
An image object, typically created using the [page:TextureLoader.load] method.
This can be any image (e.g., PNG, JPG, GIF, DDS) or video (e.g., MP4, OGG/OGV) type supported by three.js.<br /><br />
一个图片对象,通常由[page:TextureLoader.load]方法创建。
该对象可以是被three.js所支持的任意图片(例如PNG、JPG、GIF、DDS)或视频(例如MP4、OGG/OGV)格式。<br /><br />
To use video as a texture you need to have a playing HTML5
video element as a source for your texture image and continuously update this texture
as long as video is playing - the [page:VideoTexture VideoTexture] class handles this automatically.
要使用视频来作为纹理贴图,你需要有一个正在播放的HTML5 Video元素来作为你纹理贴图的源图像,
并在视频播放时不断地更新这个纹理贴图。——[page:VideoTexture VideoTexture] 类会对此自动进行处理。
</p>
<h3>[property:array mipmaps]</h3>
<p>
Array of user-specified mipmaps (optional).
用户所给定的mipmap数组(可选)。
</p>
<h3>[property:number mapping]</h3>
<p>
How the image is applied to the object. An object type of [page:Textures THREE.UVMapping] is the default,
where the U,V coordinates are used to apply the map.<br />
图像将如何应用到物体(对象)上。默认值是[page:Textures THREE.UVMapping]对象类型,
即UV坐标将被用于纹理映射。<br />
See the [page:Textures texture constants] page for other mapping types.
请参阅[page:Textures texture constants](映射模式常量)来了解其他映射类型。
</p>
<h3>[property:number wrapS]</h3>
<p>
This defines how the texture is wrapped horizontally and corresponds to *U* in UV mapping.<br />
The default is [page:Textures THREE.ClampToEdgeWrapping], where the edge is clamped to the outer edge texels.
The other two choices are [page:Textures THREE.RepeatWrapping] and [page:Textures THREE.MirroredRepeatWrapping].
See the [page:Textures texture constants] page for details.
这个值定义了纹理贴图在水平方向上将如何包裹,在UV映射中对应于*U*。<br />
默认值是[page:Textures THREE.ClampToEdgeWrapping],即纹理边缘将被推到外部边缘的纹素。
其它的两个选项分别是[page:Textures THREE.RepeatWrapping]和[page:Textures THREE.MirroredRepeatWrapping]。
请参阅[page:Textures texture constants]来了解详细信息。
</p>
<h3>[property:number wrapT]</h3>
<p>
This defines how the texture is wrapped vertically and corresponds to *V* in UV mapping.<br />
The same choices are available as for [property:number wrapS].<br /><br />
这个值定义了纹理贴图在垂直方向上将如何包裹,在UV映射中对应于*V*。<br />
可以使用与[property:number wrapS]相同的选项。<br /><br />
NOTE: tiling of images in textures only functions if image dimensions are powers of two
(2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, ...) in terms of pixels.
Individual dimensions need not be equal, but each must be a power of two.
This is a limitation of WebGL, not three.js.
请注意:纹理中图像的平铺,仅有当图像大小(以像素为单位)为2的幂(2、4、8、16、32、64、128、256、512、1024、2048、……)时才起作用。
宽度、高度无需相等,但每个维度的长度必须都是2的幂。
这是WebGL中的限制,不是由three.js所限制的。
</p>
<h3>[property:number magFilter]</h3>
<p>
How the texture is sampled when a texel covers more than one pixel. The default is
[page:Textures THREE.LinearFilter], which takes the four closest texels and bilinearly interpolates among them.
The other option is [page:Textures THREE.NearestFilter], which uses the value of the closest texel.<br />
See the [page:Textures texture constants] page for details.
当一个纹素覆盖大于一个像素时,贴图将如何采样。默认值为[page:Textures THREE.LinearFilter],
它将获取四个最接近的纹素,并在他们之间进行双线性插值。
另一个选项是[page:Textures THREE.NearestFilter],它将使用最接近的纹素的值。<br />
请参阅[page:Textures texture constants]页面来了解详细信息。
</p>
<h3>[property:number minFilter]</h3>
<p>
How the texture is sampled when a texel covers less than one pixel. The default is
[page:Textures THREE.LinearMipMapLinearFilter], which uses mipmapping and a trilinear filter. <br /><br />
当一个纹素覆盖小于一个像素时,贴图将如何采样。默认值为[page:Textures THREE.LinearMipMapLinearFilter],
它将使用mipmapping以及三次线性滤镜。<br /><br />
See the [page:Textures texture constants] page for all possible choices.
请参阅[page:Textures texture constants]页面来了解所有可能的选项。
</p>
<h3>[property:number anisotropy]</h3>
<p>
The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap,
at the cost of more texture samples being used. Use [page:WebGLRenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to
find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
沿着轴,通过具有最高纹素密度的像素的样本数。
默认情况下,这个值为1。设置一个较高的值将会产生比基本的mipmap更清晰的效果,代价是需要使用更多纹理样本。
使用[page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() 来查询GPU中各向异性的最大有效值;这个值通常是2的幂。
</p>
<h3>[property:number format]</h3>
<p>
The default is [page:Textures THREE.RGBAFormat], although the [page:TextureLoader TextureLoader] will automatically
set this to [page:Textures THREE.RGBFormat] for JPG images. <br /><br />
默认值为[page:Textures THREE.RGBAFormat],
但[page:TextureLoader TextureLoader]将会在载入JPG图片时自动将这个值设置为[page:Textures THREE.RGBFormat]。<br /><br />
See the [page:Textures texture constants] page for details of other formats.
请参阅[page:Textures texture constants]页面来了解其它格式。
</p>
<h3>[property:number type]</h3>
<p>
This must correspond to the [page:Texture.format .format]. The default is [page:Textures THREE.UnsignedByteType],
which will be used for most texture formats.<br /><br />
这个值必须与[page:Texture.format .format]相对应。默认值为[page:Textures THREE.UnsignedByteType],
它将会被用于绝大多数纹理格式。<br /><br />
See the [page:Textures texture constants] page for details of other formats.
请参阅[page:Textures texture constants]来了解其它格式。
</p>
<h3>[property:Vector2 offset]</h3>
<p>
How much a single repetition of the texture is offset from the beginning, in each direction U and V.
Typical range is *0.0* to *1.0*. _Note:_ The offset property is a convenience modifier and only affects
the Texture's application to the first set of UVs on a model. If the Texture is used as a map requiring
additional UV sets (e.g. the aoMap or lightMap of most stock materials), those UVs must be manually
assigned to achieve the desired offset.
纹理在单次重复时,从一开始将分别在U、V方向上偏移多少。
这个值的范围通常在*0.0*之间*1.0*。
请注意:这一属性是一个非常方便的修改器,仅仅影响纹理对模型上第一组UV的应用。
如果该纹理被用于需要额外的UV集的贴图(例如一些成品材质中的aoMap或lightMap),
这些UV必须被手动调整来实现所期望的偏移。
</p>
<h3>[property:Vector2 repeat]</h3>
<p>
How many times the texture is repeated across the surface, in each direction U and V. If repeat is set
greater than 1 in either direction, the corresponding Wrap parameter should also be set to
[page:Textures THREE.RepeatWrapping] or [page:Textures THREE.MirroredRepeatWrapping] to achieve the desired
tiling effect. _Note:_ The repeat property is a convenience modifier and only affects
the Texture's application to the first set of UVs on a model. If the Texture is used as a map requiring
additional UV sets (e.g. the aoMap or lightMap of most stock materials), those UVs must be manually
assigned to achieve the desired repetiton.
纹理将在表面上,分别在U、V方向重复多少次。如果这个值在任意方向上设置为大于1,
则对应的Wrap参数应当也被设为[page:Textures THREE.RepeatWrapping]或[page:Textures THREE.MirroredRepeatWrapping],
以实现所期望的平铺效果。
请注意:这一属性是一个非常方便的修改器,仅仅影响纹理对模型上第一组UV的应用。
如果该纹理被用于需要额外的UV集的贴图(例如一些成品材质中的aoMap或lightMap),
这些UV必须被手动调整来实现所期望的重复。
</p>
<h3>[property:number rotation]</h3>
<p>
How much the texture is rotated around the center point, in radians. Postive values are counter-clockwise. Default is *0*.
纹理将围绕中心点旋转多少度,单位为弧度(rad)。正值为逆时针方向旋转,默认值为*0*。
</p>
<h3>[property:Vector2 center]</h3>
<p>
The point around which rotation occurs. A value of (0.5, 0.5) corresponds to the center of the texture. Default is (0, 0), the lower left.
旋转中心点。(0.5, 0.5)对应纹理的正中心。默认值为(0,0),即左下角。
</p>
<h3>[property:boolean matrixAutoUpdate]</h3>
<p>
Whether to update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center]. True by default.
Set this to false if you are specifying the uv-transform matrix directly.
是否从纹理的[page:Texture.offset .offset]、[page:Texture.repeat .repeat]、[page:Texture.rotation .rotation]和[page:Texture.center .center]属性更新纹理的UV变换矩阵(uv-transform [page:Texture.matrix .matrix])。
默认值为true。
如果你要直接指定纹理的变换矩阵,请将其设为false。
</p>
<h3>[property:Matrix3 matrix]</h3>
<p>
The uv-transform matrix for the texture. Updated by the renderer from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center] when the texture's [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is true.
When [page:Texture.matrixAutoUpdate .matrixAutoUpdate] property is false, this matrix may be set manually.
Default is the identity matrix.
纹理的UV变换矩阵。
当纹理的[page:Texture.matrixAutoUpdate .matrixAutoUpdate]属性为true时,
由渲染器从纹理的[page:Texture.offset .offset]、[page:Texture.repeat .repeat]、[page:Texture.rotation .rotation]和[page:Texture.center .center]属性中进行更新。
当[page:Texture.matrixAutoUpdate .matrixAutoUpdate]属性为false时,该矩阵可以被手动设置。
默认值为单位矩阵。
</p>
<h3>[property:boolean generateMipmaps]</h3>
<p>
Whether to generate mipmaps (if possible) for a texture. True by default. Set this to false if you are
creating mipmaps manually.
是否为纹理生成mipmap(如果可用)。默认为true。
如果你手动生成mipmap,请将其设为false。
</p>
<h3>[property:boolean premultiplyAlpha]</h3>
<p>
False by default, which is the norm for PNG images. Set to true if the RGB values have
been stored premultiplied by alpha.
默认为false,这是PNG图像的规范。
如果RGB值已被Alpha预乘,请将其设为true。
</p>
<h3>[property:boolean flipY]</h3>
<p>
True by default. Flips the image's Y axis to match the WebGL texture coordinate space.
默认为true。翻转图像的Y轴以匹配WebGL纹理坐标空间。
</p>
<h3>[property:number unpackAlignment]</h3>
<p>
4 by default. Specifies the alignment requirements for the start of each pixel row in memory.
The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes),
4 (word-alignment), and 8 (rows start on double-word boundaries).
See [link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei]
for more information.
默认为4。指定内存中每个像素行起点的对齐要求。
允许的值为1(字节对齐)、2(行对齐到偶数字节)、4(字对齐)和8(行从双字边界开始)。
请参阅[link:http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml glPixelStorei]来了解详细信息。
</p>
<h3>[property:number encoding]</h3>
<p>
[page:Textures THREE.LinearEncoding] is the default.
See the [page:Textures texture constants] page for details of other formats.<br /><br />
默认值为[page:Textures THREE.LinearEncoding]。
请参阅[page:Textures texture constants]来了解其他格式的详细信息。<br /><br />
Note that if this value is changed on a texture after the material has been used,
it is necessary to trigger a Material.needsUpdate for this value to be realized in the shader.
请注意,如果在材质被使用之后,纹理贴图中这个值发生了改变,
需要触发Material.needsUpdate,来使得这个值在着色器中实现。
</p>
<h3>[property:Integer version]</h3>
<p>
This starts at *0* and counts how many times [property:Boolean needsUpdate] is set to *true*.
这个值起始值为*0*,计算[property:Boolean needsUpdate]被设置为*true*的次数。
</p>
<h3>[property:Function onUpdate]</h3>
<p>
A callback function, called when the texture is updated (e.g., when needsUpdate has been set to true
and then the texture is used).
一个回调函数,在纹理被更新后调用。
(例如,当needsUpdate被设为true且纹理被使用。)
</p>
<h3>[property:Boolean needsUpdate]</h3>
<p>
Set this to *true* to trigger an update next time the texture is used. Particularly important for setting the wrap mode.
将其设置为*true*,以便在下次使用纹理时触发一次更新。
这对于设置包裹模式尤其重要。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<h3>[page:EventDispatcher EventDispatcher] methods are available on this class.</h3>
<h3>[page:EventDispatcher EventDispatcher]方法在这个类上可以使用。</h3>
<h3>[method:null updateMatrix]()</h3>
<p>
Update the texture's uv-transform [page:Texture.matrix .matrix] from the texture properties [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.rotation .rotation], and [page:Texture.center .center].
从纹理的[page:Texture.offset .offset]、[page:Texture.repeat .repeat]、
[page:Texture.rotation .rotation]和[page:Texture.center .center]属性来更新纹理的UV变换矩阵(uv-transform [page:Texture.matrix .matrix])。
</p>
<h3>[method:Texture clone]()</h3>
<p>
Make copy of the texture. Note this is not a "deep copy", the image is shared.
拷贝纹理。请注意。这不是“深拷贝”,图像是共用的。
</p>
<h3>[method:Texture toJSON]( [param:Object meta] )</h3>
<p>
meta -- optional object containing metadata.<br />
Convert the material to three.js JSON format.
meta -- 可选,包含有元数据的对象。<br />
将材质转换为three.js JSON格式。
</p>
<h3>[method:null dispose]()</h3>
<p>
Call [page:EventDispatcher EventDispatcher].dispatchEvent with a 'dispose' event type.
使用“dispose”事件类型调用[page:EventDispatcher EventDispatcher].dispatchEvent。
</p>
<h3>[method:Vector2 transformUv]( [param:Vector2 uv] )</h3>
<p>
Transform the uv based on the value of this texture's [page:Texture.offset .offset], [page:Texture.repeat .repeat],
[page:Texture.wrapS .wrapS], [page:Texture.wrapT .wrapT] and [page:Texture.flipY .flipY] properties.
基于纹理的[page:Texture.offset .offset]、[page:Texture.repeat .repeat]、
[page:Texture.wrapS .wrapS]、[page:Texture.wrapT .wrapT]和[page:Texture.flipY .flipY]属性值来变换uv。
</p>
<h2>Source</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -10,15 +10,15 @@
<body>
[page:Texture] &rarr;
<h1>[name]</h1>
<h1>视频纹理([name])</h1>
<p class="desc">
Creates a texture for use with a video texture.<br /><br />
创建一个使用视频来作为贴图的纹理对象。<br /><br />
This is almost the same as the base [page:Texture Texture] class, except that it continuosly sets [page:Texture.needsUpdate needsUpdate] to *true* so that the texture is updated as the video plays. Automatic creation of [page:Texture.mipmaps mipmaps] is also disabled.
它和其基类[page:Texture Texture]几乎是相同的,除了它总是将[page:Texture.needsUpdate needsUpdate]设置为*true*,以便使得贴图能够在视频播放时进行更新。自动创建[page:Texture.mipmaps mipmaps]也会被禁用。
</p>
<h2>Example</h2>
<h2>示例</h2>
<p>[example:webgl_materials_video materials / video ]</p>
......@@ -33,63 +33,63 @@ texture.format = THREE.RGBFormat;
</code>
<h2>Constructor</h2>
<h2>构造函数</h2>
<h3>[name]( [param:Video video], [param:Constant mapping], [param:Constant wrapS], [param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter], [param:Constant format], [param:Constant type], [param:Number anisotropy] )</h3>
<p>
[page:Video video] -- The video element to use as the texture. <br />
[page:Video video] -- 将被作为纹理贴图来使用的Video元素。<br />
[page:Constant mapping] -- How the image is applied to the object. An object type of [page:Textures THREE.UVMapping].
See [page:Textures mapping constants] for other choices.<br />
[page:Constant mapping] -- 纹理贴图将被如何应用(映射)到物体上,它是[page:Textures THREE.UVMapping]中的对象类型。
请参阅[page:Textures mapping constants](映射模式常量)来了解其他选项。<br />
[page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for other choices.<br />
[page:Constant wrapS] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
See [page:Textures wrap mode constants] for other choices.<br />
[page:Constant wrapT] -- 默认值是[page:Textures THREE.ClampToEdgeWrapping].
请参阅[page:Textures wrap mode constants](包裹模式常量)来了解其他选项。<br />
[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
The default is [page:Textures THREE.LinearFilter]. See [page:Textures magnification filter constants] for other choices.<br />
[page:Constant magFilter] -- 当一个纹素覆盖大于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.LinearFilter]。请参阅[page:Textures magnification filter constants](放大滤镜常量)来了解其它选项。<br />
[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
The default is [page:Textures THREE.LinearMipMapLinearFilter]. See [page:Textures minification filter constants] for other choices.<br />
[page:Constant minFilter] -- 当一个纹素覆盖小于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.LinearMipMapLinearFilter]。请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其它选项。<br />
[page:Constant format] -- The format used in the texture.
See [page:Textures format constants] for other choices.<br />
[page:Constant format] -- 在纹理贴图中使用的格式。
请参阅[page:Textures format constants](格式常量)来了解各个选项。<br />
[page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
See [page:Textures type constants] for other choices.<br />
[page:Constant type] -- 默认值是[page:Textures THREE.UnsignedByteType].
请参阅[page:Textures type constants](类型常量)来了解其他选项。<br />
[page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br /><br />
[page:Number anisotropy] -- 沿着轴,通过具有最高纹素密度的像素的采样数。
默认情况下,这个值为1。设置一个较高的值将会比基本的mipmap产生更清晰的效果,代价是需要使用更多纹理样本。
使用[page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() 来查询GPU中各向异性的最大有效值;这个值通常是2的幂。<br /><br />
</p>
<h2>Properties</h2>
<h2>属性</h2>
<p>
See the base [page:Texture Texture] class for common properties.
请参阅其基类[page:Texture Texture]来了解共有属性。
</p>
<h3>[property:boolean needsUpdate]</h3>
<p>
You will not need to set this manually here as it is handled by the [page:VideoTexture.update update] method.
在这里,你不必手动设置这个值,因为它是由[page:VideoTexture.update update]方法来进行控制的。
</p>
<h2>Methods</h2>
<h2>方法</h2>
<p>
See the base [page:Texture Texture] class for common methods.
请参阅其基类[page:Texture Texture]来查看共有方法。
</p>
<h3>[method:null update]()</h3>
<p>
This is called automatically and sets [property:boolean needsUpdate] to *true* every time
a new frame is available.
在每一次新的一帧可用时,这个方法将被自动调用,
并将[property:boolean needsUpdate]设置为*true*。
</p>
<h2>Source</h2>
<h2>源代码</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
......
......@@ -31,7 +31,7 @@
<li>KHR_draco_mesh_compression</li>
<li>KHR_materials_pbrSpecularGlossiness</li>
<li>KHR_materials_unlit</li>
<li>KHR_lights_punctual (experimental)</li>
<li>KHR_lights_punctual</li>
<li>KHR_texture_transform<sup>*</sup></li>
<li>MSFT_texture_dds</li>
</ul>
......
......@@ -110,6 +110,29 @@
[page:String crossOrigin] — The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
</p>
<h3>[method:MMDLoader setAnimationPath]( [param:String animationPath] )</h3>
<p>
[page:String animationPath] — Base path for loading animation data (VMD/VPD files).
</p>
<p>
Set the base path for additional resources like textures.
</p>
<h3>[method:MMDLoader setPath]( [param:String path] )</h3>
<p>
[page:String path] — Base path.
</p>
<p>
Sets the base path or URL from which to load files.
</p>
<h3>[method:MMDLoader setResourcePath]( [param:String resourcePath] )</h3>
<p>
[page:String resourcePath] — Base path for loading additional resources e.g. textures.
</p>
<p>
Set the base path for additional resources like textures.
</p>
<h2>Source</h2>
......
......@@ -91,7 +91,7 @@
<h3>[method:null load]( [param:String url], [param:Function onLoad], [param:Function onProgress], [param:Function onError] )</h3>
<p>
[page:String url] — A string containing the path/URL of the <em>.svg</em> file.<br />
[page:Function onLoad] — (optional) A function to be called after loading is successfully completed. The function receives the loaded [page:SVGDocument] as an argument.<br />
[page:Function onLoad] — (optional) A function to be called after loading is successfully completed. The function receives an array of [page:ShapePath] as an argument.<br />
[page:Function onProgress] — (optional) A function to be called while the loading is in progress. The argument will be the XMLHttpRequest instance, which contains [page:Integer total] and [page:Integer loaded] bytes.<br />
[page:Function onError] — (optional) A function to be called if an error occurs during loading. The function receives the error as an argument.<br />
</p>
......
......@@ -25,9 +25,10 @@
</p>
<h3>[method:BufferGeometry mergeBufferGeometries]( [param:Array geometries] )</h3>
<h3>[method:BufferGeometry mergeBufferGeometries]( [param:Array geometries], [param:Boolean useGroups] )</h3>
<p>
geometries -- Array of [page:BufferGeometry BufferGeometry] instances.<br /><br />
geometries -- Array of [page:BufferGeometry BufferGeometry] instances.<br />
useGroups -- Whether groups should be generated for the merged geometry or not.<br /><br />
Merges a set of geometries into a single instance. All geometries must have compatible attributes.
If merge does not succeed, the method returns null.<br /><br />
......
......@@ -29,11 +29,11 @@
<h3>[method:null attach]( [param:Object3D child], [param:Object3D scene], [param:Object3D parent] )</h3>
<p>
child -- The object to add to the parent <br />
scene -- The scene to detach the object on. <br />
parent -- The parent to attach the object from.
scene -- The scene to detach the object from. <br />
parent -- The parent to attach the object to.
</p>
<p>
Attaches the object to the parent without the moving the object in the worldspace. Beware that to do this the matrixWorld needs to be updated, this can be done by calling the updateMatrixWorld method on the parent object.
Attaches the object to the parent without the moving the object in the worldspace. Beware that to do this the matrixWorld needs to be updated. This can be done by calling the updateMatrixWorld method on the parent object.
</p>
<h3>[method:null detach]( [param:Object3D child], [param:Object3D parent], [param:Object3D scene] )</h3>
......@@ -43,7 +43,7 @@
parent -- The parent to detach the object from.
</p>
<p>
Detaches the object from the parent and adds it back to the scene without moving in worldspace. Beware that to do this the matrixWorld needs to be updated, this can be done by calling the updateMatrixWorld method on the parent object.
Detaches the object from the parent and adds it back to the scene without moving in worldspace. Beware that to do this the matrixWorld needs to be updated. This can be done by calling the updateMatrixWorld method on the parent object.
</p>
<h2>Source</h2>
......
此差异已折叠。
......@@ -107,7 +107,6 @@
</p>
<ul>
<li>[page:JSONLoader THREE.JSONLoader]</li>
<li>[page:ObjectLoader THREE.ObjectLoader]</li>
<li>THREE.BVHLoader</li>
<li>THREE.ColladaLoader</li>
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册