提交 636376a4 编写于 作者: M Mr.doob

r131

上级 d95e51b7
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -42,6 +42,11 @@
ترجاع *true* إذا كان الكائن مصفوفة مكتوبة (typed array.).
</p>
<h3>[method:AnimationClip makeClipAdditive]( [param:AnimationClip targetClip], [param:Number referenceFrame], [param:AnimationClip referenceClip], [param:Number fps] )</h3>
<p>
Converts the keyframes of the given animation clip to an additive format.
</p>
<h3>[method:Array sortedArray]( values, stride, order )</h3>
<p>
يفرز المصفوفة التي تم إرجاعها مسبقًا بناءا [page:AnimationUtils.getKeyframeOrder getKeyframeOrder].
......
......@@ -42,6 +42,11 @@
Returns *true* if the object is a typed array.
</p>
<h3>[method:AnimationClip makeClipAdditive]( [param:AnimationClip targetClip], [param:Number referenceFrame], [param:AnimationClip referenceClip], [param:Number fps] )</h3>
<p>
Converts the keyframes of the given animation clip to an additive format.
</p>
<h3>[method:Array sortedArray]( values, stride, order )</h3>
<p>
Sorts the array previously returned by [page:AnimationUtils.getKeyframeOrder getKeyframeOrder].
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>Buffer Attribute Usage Constants</h1>
<p>
The usage constants can be used to provide a hint to the API regarding how the geometry buffer attribute will be used in order to optimize performance.
</p>
<h2>Code Example</h2>
<code>
const geometry = new THREE.BufferGeometry();
const positionAttribute = new THREE.BufferAttribute( array, 3 , false );
positionAttribute.setUsage( THREE.DynamicDrawUsage );
geometry.setAttribute( 'position', positionAttribute );
</code>
<h2>Examples</h2>
<p>[example:webgl_buffergeometry_drawrange materials / buffergeometry / drawrange ]</p>
<h2>Geometry Usage</h2>
<code>
THREE.StaticDrawUsage
THREE.DynamicDrawUsage
THREE.StreamDrawUsage
THREE.StaticReadUsage
THREE.DynamicReadUsage
THREE.StreamReadUsage
THREE.StaticCopyUsage
THREE.DynamicCopyUsage
THREE.StreamCopyUsage
</code>
For more detailed information on each of these constants see [link:https://www.khronos.org/opengl/wiki/Buffer_Object#Buffer_Object_Usage this OpenGL documentation].
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
</p>
</body>
</html>
......@@ -48,6 +48,7 @@
<code>
THREE.NeverDepth
THREE.AlwaysDepth
THREE.EqualDepth
THREE.LessDepth
THREE.LessEqualDepth
THREE.GreaterEqualDepth
......@@ -58,6 +59,7 @@
Which depth function the material uses to compare incoming pixels Z-depth against the current Z-depth buffer value. If the result of the comparison is true, the pixel will be drawn.<br />
[page:Materials NeverDepth] will never return true.<br />
[page:Materials AlwaysDepth] will always return true.<br />
[page:Materials EqualDepth] will return true if the incoming pixel Z-depth is equal to the current buffer Z-depth.<br />
[page:Materials LessDepth] will return true if the incoming pixel Z-depth is less than the current buffer Z-depth.<br />
[page:Materials LessEqualDepth] is the default and will return true if the incoming pixel Z-depth is less than or equal to the current buffer Z-depth.<br />
[page:Materials GreaterEqualDepth] will return true if the incoming pixel Z-depth is greater than or equal to the current buffer Z-depth.<br />
......
......@@ -97,7 +97,7 @@
<p>
Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is *THREE.StaticDrawUsage*.
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
</p>
<h3>[property:Integer version]</h3>
......@@ -179,7 +179,7 @@
</p>
<h3>[method:BufferAttribute setUsage] ( [param:Usage value] ) </h3>
<p>Set [page:BufferAttribute.usage usage] to value.</p>
<p>Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.</p>
<h3>[method:BufferAttribute setX]( [param:Integer index], [param:Float x] ) </h3>
<p>Sets the x component of the vector at the given index.</p>
......
......@@ -31,6 +31,9 @@
<h2>Methods</h2>
<p>See [page:BufferGeometry] for inherited methods.</p>
<h3>[method:InstancedBufferGeometry copy]( [param:InstancedBufferGeometry source] )</h3>
<p>Copies the given [name] to this instance.</p>
<h2>Source</h2>
<p>
......
......@@ -33,8 +33,8 @@
<h2>Code Example</h2>
<code>const geometry = new THREE.SphereGeometry( 5, 32, 32 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
<code>const geometry = new THREE.SphereGeometry( 15, 32, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const sphere = new THREE.Mesh( geometry, material );
scene.add( sphere );
</code>
......@@ -45,8 +45,8 @@
<p>
radius — sphere radius. Default is 1.<br />
widthSegments — number of horizontal segments. Minimum value is 3, and the default is 8.<br />
heightSegments — number of vertical segments. Minimum value is 2, and the default is 6.<br />
widthSegments — number of horizontal segments. Minimum value is 3, and the default is 32.<br />
heightSegments — number of vertical segments. Minimum value is 2, and the default is 16.<br />
phiStart — specify horizontal starting angle. Default is 0.<br />
phiLength — specify horizontal sweep angle size. Default is Math.PI * 2.<br />
thetaStart — specify vertical starting angle. Default is 0.<br />
......
......@@ -87,9 +87,6 @@
property and it is ignored by the [page:WebGLRenderer WebGL] renderer.
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h2>Methods</h2>
<p>See the base [page:Material] class for common methods.</p>
......
......@@ -92,10 +92,6 @@
<h3>[property:Texture map]</h3>
<p>The color map. Default is null.</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Float reflectivity]</h3>
<p>
How much the environment map affects the surface; also see [page:.combine].
......
......@@ -84,9 +84,6 @@
<h3>[property:Texture map]</h3>
<p>The color map. Default is null.</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Boolean wireframe]</h3>
<p>Render geometry as wireframe. Default is false (i.e. render as smooth shaded).</p>
......
......@@ -95,9 +95,6 @@
<h3>[property:Texture map]</h3>
<p>The color map. Default is null.</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Float nearDistance]</h3>
<p>
The near value of the point light's internal shadow camera.
......
......@@ -119,15 +119,6 @@
<h3>[property:Texture map]</h3>
<p>The color map. Default is null.</p>
<h3>[property:Boolean morphNormals]</h3>
<p>
Defines whether the material uses morphNormals. Set as true to pass morphNormal
attributes from the geometry to the shader. Default is *false*.
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Float reflectivity]</h3>
<p>How much the environment map affects the surface; also see [page:.combine].</p>
......
......@@ -106,15 +106,6 @@
<h3>[property:Texture matcap]</h3>
<p>The matcap map. Default is null.</p>
<h3>[property:Boolean morphNormals]</h3>
<p>
Defines whether the material uses morphNormals. Set as true to pass morphNormal
attributes from the geometry to the shader. Default is *false*.
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Texture normalMap]</h3>
<p>
The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change
......
......@@ -83,15 +83,6 @@
<h3>[property:Boolean fog]</h3>
<p>Whether the material is affected by fog. Default is *false*.</p>
<h3>[property:Boolean morphNormals]</h3>
<p>
Defines whether the material uses morphNormals. Set as true to pass morphNormal
attributes from the geometry to the shader. Default is *false*.
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Texture normalMap]</h3>
<p>
The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change
......
......@@ -156,15 +156,6 @@
<h3>[property:Texture map]</h3>
<p>The color map. Default is null. The texture map color is modulated by the diffuse [page:.color].</p>
<h3>[property:Boolean morphNormals]</h3>
<p>
Defines whether the material uses morphNormals. Set as true to pass morphNormal
attributes from the geometry to the shader. Default is *false*.
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Texture normalMap]</h3>
<p>
The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change
......
......@@ -196,15 +196,6 @@
<h3>[property:Texture metalnessMap]</h3>
<p>The blue channel of this texture is used to alter the metalness of the material.</p>
<h3>[property:Boolean morphNormals]</h3>
<p>
Defines whether the material uses morphNormals. Set as true to pass morphNormal
attributes from the geometry to the shader. Default is *false*.
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Texture normalMap]</h3>
<p>
The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change
......@@ -242,13 +233,6 @@
<h3>[property:Texture roughnessMap]</h3>
<p>The green channel of this texture is used to alter the roughness of the material.</p>
<h3>[property:Boolean vertexTangents]</h3>
<p>
Defines whether precomputed vertex tangents, which must be provided in a vec4 "tangent" attribute,
are used. When disabled, tangents are derived automatically. Using precomputed tangents will give
more accurate normal map details in some cases, such as with mirrored UVs. Default is false.
</p>
<h3>[property:Boolean wireframe]</h3>
<p>Render geometry as wireframe. Default is *false* (i.e. render as flat polygons).</p>
......
......@@ -133,15 +133,6 @@
<h3>[property:Texture map]</h3>
<p>The color map. Default is null. The texture map color is modulated by the diffuse [page:.color].</p>
<h3>[property:Boolean morphNormals]</h3>
<p>
Defines whether the material uses morphNormals. Set as true to pass morphNormal
attributes from the geometry to the shader. Default is *false*.
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Texture normalMap]</h3>
<p>
The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change
......
......@@ -82,12 +82,8 @@
<p>[page:Color] of the material, by default set to white (0xffffff).</p>
<h3>[property:Texture map]</h3>
<p>Sets the color of the points using data from a [page:Texture].</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Number size]</h3>
<p>Sets the size of the points. Default is 1.0.<br/>
Will be capped if it exceeds the hardware dependent parameter [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter gl.ALIASED_POINT_SIZE_RANGE].</p>
......
......@@ -367,17 +367,6 @@ this.extensions = {
always be 1 regardless of the set value.
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>
When set to true, morph target attributes are available in the vertex shader. Default is *false*.
</p>
<h3>[property:Boolean morphNormals]</h3>
<p>
When set to true, morph normal attributes are available in the vertex shader. Default is *false*.
</p>
<h3>[property:Boolean flatShading]</h3>
<p>
Define whether the material is rendered with flat shading. Default is false.
......
......@@ -42,6 +42,11 @@
타입 배열이면 *true*를 리턴합니다.
</p>
<h3>[method:AnimationClip makeClipAdditive]( [param:AnimationClip targetClip], [param:Number referenceFrame], [param:AnimationClip referenceClip], [param:Number fps] )</h3>
<p>
Converts the keyframes of the given animation clip to an additive format.
</p>
<h3>[method:Array sortedArray]( values, stride, order )</h3>
<p>
이전에 [page:AnimationUtils.getKeyframeOrder getKeyframeOrder]를 통해 리턴된 배열을 정렬합니다.
......
......@@ -37,17 +37,16 @@
返回一个数组,时间和值可以根据此数组排序。
</p>
<h3>[method:Number insertKeyframe]( [param:KeyframeTrack track], [param:Number time] )</h3>
<p></p>
<h3>[method:Boolean isTypedArray]( object )</h3>
<p>
如果该对象是类型化数组,返回*true*
</p>
<h3>[method:AnimationClip mergeMorphTargetTracks]( [param:AnimationClip clip], [param:Object3D root] )</h3>
<p></p>
<h3>[method:AnimationClip makeClipAdditive]( [param:AnimationClip targetClip], [param:Number referenceFrame], [param:AnimationClip referenceClip], [param:Number fps] )</h3>
<p>
Converts the keyframes of the given animation clip to an additive format.
</p>
<h3>[method:Array sortedArray]( values, stride, order )</h3>
<p>
......
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>Buffer Attribute Usage Constants</h1>
<p>
The usage constants can be used to provide a hint to the API regarding how the geometry buffer attribute will be used in order to optimize performance.
</p>
<h2>Code Example</h2>
<code>
const geometry = new THREE.BufferGeometry();
const positionAttribute = new THREE.BufferAttribute( array, 3 , false );
positionAttribute.setUsage( THREE.DynamicDrawUsage );
geometry.setAttribute( 'position', positionAttribute );
</code>
<h2>Examples</h2>
<p>[example:webgl_buffergeometry_drawrange materials / buffergeometry / drawrange ]</p>
<h2>Geometry Usage</h2>
<code>
THREE.StaticDrawUsage
THREE.DynamicDrawUsage
THREE.StreamDrawUsage
THREE.StaticReadUsage
THREE.DynamicReadUsage
THREE.StreamReadUsage
THREE.StaticCopyUsage
THREE.DynamicCopyUsage
THREE.StreamCopyUsage
</code>
For more detailed information on each of these constants see [link:https://www.khronos.org/opengl/wiki/Buffer_Object#Buffer_Object_Usage this OpenGL documentation].
<h2>Source</h2>
<p>
[link:https://github.com/mrdoob/three.js/blob/master/src/constants.js src/constants.js]
</p>
</body>
</html>
......@@ -35,7 +35,7 @@
[page:constant BasicShadowMap] 能够给出没有经过过滤的阴影映射 —— 速度最快,但质量最差。<br />
[page:constant PCFShadowMap] 为默认值,使用Percentage-Closer Filtering (PCF)算法来过滤阴影映射。<br />
[page:constant PCFSoftShadowMap] filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm with better soft shadows especially when using low-resolution shadow maps.<br />
[page:constant PCFSoftShadowMap] 和PCFShadowMap一样使用 Percentage-Closer Filtering (PCF) 算法过滤阴影映射,但在使用低分辨率阴影图时具有更好的软阴影。<br />
[page:constant VSMShadowMap] 使用Variance Shadow Map (VSM)算法来过滤阴影映射。当使用VSMShadowMap时,所有阴影接收者也将会投射阴影。
</p>
......
......@@ -87,7 +87,7 @@
<p>
Defines the intended usage pattern of the data store for optimization purposes. Corresponds to the *usage* parameter of
[link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData WebGLRenderingContext.bufferData]().
Default is *THREE.StaticDrawUsage*.
Default is [page:BufferAttributeUsage StaticDrawUsage]. See usage [page:BufferAttributeUsage constants] for all possible values.
</p>
<h3>[property:Integer version]</h3>
......@@ -160,7 +160,7 @@
</p>
<h3>[method:BufferAttribute setUsage] ( [param:Usage value] ) </h3>
<p>Set [page:BufferAttribute.usage usage] to value.</p>
<p>Set [page:BufferAttribute.usage usage] to value. See usage [page:BufferAttributeUsage constants] for all possible input values.</p>
<h3>[method:BufferAttribute setX]( [param:Integer index], [param:Float x] ) </h3>
<p>设置给定索引的矢量的第一维数据(设置 X 值)。</p>
......
......@@ -31,6 +31,9 @@
<h2>方法</h2>
<p>继承方法详见 [page:BufferGeometry]。</p>
<h3>[method:InstancedBufferGeometry copy]( [param:InstancedBufferGeometry source] )</h3>
<p>Copies the given [name] to this instance.</p>
<h2>源代码</h2>
<p>
......
......@@ -33,8 +33,8 @@
<h2>代码示例</h2>
<code>const geometry = new THREE.SphereGeometry( 5, 32, 32 );
const material = new THREE.MeshBasicMaterial( {color: 0xffff00} );
<code>const geometry = new THREE.SphereGeometry( 15, 32, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
const sphere = new THREE.Mesh( geometry, material );
scene.add( sphere );
</code>
......@@ -45,8 +45,8 @@
<p>
radius — 球体半径,默认为1。<br />
widthSegments — 水平分段数(沿着经线分段),最小值为3,默认值为8<br />
heightSegments — 垂直分段数(沿着纬线分段),最小值为2,默认值为6。<br />
widthSegments — 水平分段数(沿着经线分段),最小值为3,默认值为32<br />
heightSegments — 垂直分段数(沿着纬线分段),最小值为2,默认值为16。<br />
phiStart — 指定水平(经线)起始角度,默认值为0。。<br />
phiLength — 指定水平(经线)扫描角度的大小,默认值为 Math.PI * 2。<br />
thetaStart — 指定垂直(纬线)起始角度,默认值为0。<br />
......
......@@ -76,9 +76,6 @@
并且会被[page:WebGLRenderer WebGL]渲染器忽略。
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h2>方法(Methods)</h2>
<p>共有方法请参见其基类[page:Material]。</p>
......
......@@ -82,10 +82,6 @@
<h3>[property:Texture map]</h3>
<p> 颜色贴图。默认为null。</p>
<h3>[property:Boolean morphTargets]</h3>
<p>材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Float reflectivity]</h3>
<p> 环境贴图对表面的影响程度; 见[page:.combine]。默认值为1,有效范围介于0(无反射)和1(完全反射)之间。
</p>
......
......@@ -73,9 +73,6 @@
<h3>[property:Texture map]</h3>
<p>颜色贴图。默认为null。</p>
<h3>[property:Boolean morphTargets]</h3>
<p>材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Boolean wireframe]</h3>
<p> 将几何体渲染为线框。默认值为*false*(即渲染为平滑着色)。</p>
......
......@@ -84,9 +84,6 @@
<h3>[property:Texture map]</h3>
<p>颜色贴图。默认为null。</p>
<h3>[property:Boolean morphTargets]</h3>
<p>材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Float nearDistance]</h3>
<p>
The near value of the point light's internal shadow camera.
......
......@@ -101,13 +101,6 @@
<h3>[property:Texture map]</h3>
<p>颜色贴图。默认为null。</p>
<h3>[property:Boolean morphNormals]</h3>
<p> 定义是否使用morphNormals。设置为true可将morphNormal属性从geometry传递到shader。默认值为*false*。
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>定义材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Float reflectivity]</h3>
<p> 环境贴图对表面的影响程度; 见[page:.combine]。默认值为1,有效范围介于0(无反射)和1(完全反射)之间。</p>
......
......@@ -90,13 +90,6 @@
<h3>[property:Texture matcap]</h3>
<p>matcap贴图,默认为null。</p>
<h3>[property:Boolean morphNormals]</h3>
<p> 定义是否使用morphNormals。设置为true可将morphNormal属性从geometry传递到shader。默认值为*false*。
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>定义材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Texture normalMap]</h3>
<p> 用于创建法线贴图的纹理。RGB值会影响每个像素片段的曲面法线,并更改颜色照亮的方式。法线贴图不会改变曲面的实际形状,只会改变光照。
In case the material has a normal map authored using the left handed convention, the y component of normalScale
......
......@@ -69,13 +69,6 @@
<h3>[property:Boolean fog]</h3>
<p>材质是否受雾影响。默认值为*false*。</p>
<h3>[property:Boolean morphNormals]</h3>
<p> 定义是否使用morphNormals。设置为true可将morphNormal属性从geometry传递到shader。默认值为*false*。
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>定义材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Texture normalMap]</h3>
<p> 用于创建法线贴图的纹理。RGB值会影响每个像素片段的曲面法线,并更改颜色照亮的方式。法线贴图不会改变曲面的实际形状,只会改变光照。
In case the material has a normal map authored using the left handed convention, the y component of normalScale
......
......@@ -125,13 +125,6 @@
<h3>[property:Texture map]</h3>
<p>颜色贴图。默认为null。纹理贴图颜色由漫反射颜色[page:.color]调节。</p>
<h3>[property:Boolean morphNormals]</h3>
<p> 定义是否使用morphNormals。设置为true可将morphNormal属性从geometry传递到shader。默认值为*false*。
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>定义材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Texture normalMap]</h3>
<p> 用于创建法线贴图的纹理。RGB值会影响每个像素片段的曲面法线,并更改颜色照亮的方式。法线贴图不会改变曲面的实际形状,只会改变光照。
In case the material has a normal map authored using the left handed convention, the y component of normalScale
......
......@@ -161,13 +161,6 @@
<h3>[property:Texture metalnessMap]</h3>
<p> 该纹理的蓝色通道用于改变材质的金属度。</p>
<h3>[property:Boolean morphNormals]</h3>
<p> 定义是否使用morphNormals。设置为true可将morphNormal属性从geometry传递到shader。默认值为*false*。
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>定义材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Texture normalMap]</h3>
<p>用于创建法线贴图的纹理。RGB值会影响每个像素片段的曲面法线,并更改颜色照亮的方式。法线贴图不会改变曲面的实际形状,只会改变光照。
In case the material has a normal map authored using the left handed convention, the y component of normalScale
......@@ -198,14 +191,6 @@
<h3>[property:Texture roughnessMap]</h3>
<p>该纹理的绿色通道用于改变材质的粗糙度。</p>
<h3>[property:Boolean vertexTangents]</h3>
<p>
Defines whether precomputed vertex tangents, which must be provided in a vec4 "tangent" attribute,
are used. When disabled, tangents are derived automatically. Using precomputed tangents will give
more accurate normal map details in some cases, such as with mirrored UVs. Default is false.
</p>
<h3>[property:Boolean wireframe]</h3>
<p>将几何体渲染为线框。默认值为*false*(即渲染为平面多边形)。</p>
......
......@@ -133,15 +133,6 @@
<h3>[property:Texture map]</h3>
<p>The color map. Default is null. The texture map color is modulated by the diffuse [page:.color].</p>
<h3>[property:Boolean morphNormals]</h3>
<p>
Defines whether the material uses morphNormals. Set as true to pass morphNormal
attributes from the geometry to the shader. Default is *false*.
</p>
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Texture normalMap]</h3>
<p>
The texture to create a normal map. The RGB values affect the surface normal for each pixel fragment and change
......
......@@ -82,9 +82,6 @@
<p>使用[page:Texture]中的数据设置点的颜色。</p>
<h3>[property:Boolean morphTargets]</h3>
<p>材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Number size]</h3>
<p>设置点的大小。默认值为1.0。<br/>
Will be capped if it exceeds the hardware dependent parameter [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParameter gl.ALIASED_POINT_SIZE_RANGE].</p>
......
......@@ -325,14 +325,6 @@ this.extensions = {
由于[link:https://www.khronos.org/registry/OpenGL/specs/gl/glspec46.core.pdf OpenGL Core Profile]与大多数平台上[page:WebGLRenderer WebGL]渲染器的限制,无论如何设置该值,线宽始终为1。
</p>
<h3>[property:Boolean morphTargets]</h3>
<p> When set to true, morph target attributes are available in the vertex shader. Default is *false*.
</p>
<h3>[property:Boolean morphNormals]</h3>
<p> When set to true, morph normal attributes are available in the vertex shader. Default is *false*.
</p>
<h3>[property:Boolean flatShading]</h3>
<p> 定义材质是否使用平面着色进行渲染。默认值为false。
</p>
......
......@@ -102,9 +102,7 @@ zAxis = (c, f, i)
<h3>[method:this invert]()</h3>
<p>
Inverts this matrix, using the [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method].
You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.
将当前矩阵翻转为它的逆矩阵,使用 [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method] 解析方式。你不能对行或列为 0 的矩阵进行翻转,如果你尝试这样做,该方法将生成一个零矩阵。
</p>
<h3>[method:this getNormalMatrix]( [param:Matrix4 m] )</h3>
......@@ -153,7 +151,7 @@ zAxis = (c, f, i)
<p>将矩阵[page:Matrix3 m]乘以当前矩阵。</p>
<h3>[method:this setFromMatrix4]( [param:Matrix4 m] )</h3>
<p>将当前矩阵设置为4X4矩阵[page:Matrix4 m]左上3X3</p>
<p>根据参数 [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>
......
......@@ -175,9 +175,7 @@ zAxis = (c, g, k)
<h3>[method:this invert]()</h3>
<p>
Inverts this matrix, using the [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method].
You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.
将当前矩阵翻转为它的逆矩阵,使用 [link:https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution analytic method] 解析方式。你不能对行或列为 0 的矩阵进行翻转,如果你尝试这样做,该方法将生成一个零矩阵。
</p>
<h3>[method:Float getMaxScaleOnAxis]()</h3>
......@@ -353,7 +351,7 @@ x, y, 1, 0,
</p>
<h3>[method:this setFromMatrix3]( [param:Matrix3 m] )</h3>
<p>Set the upper 3x3 elements of this matrix to the values of the Matrix3 [page:Matrix3 m].</p>
<p>根据参数 [page:Matrix3 m] 的值,设置当前矩阵左上 3x3 的矩阵值。</p>
<h3>[method:this setPosition]( [param:Vector3 v] )</h3>
<h3>[method:this setPosition]( [param:Float x], [param:Float y], [param:Float z] ) // optional API</h3>
......
......@@ -216,7 +216,7 @@ controls.mouseButtons = {
<h3>[property:Vector3 position0]</h3>
<p>
Used internally by the [method:saveState] and [method:reset] methods.
Used internally by the [page:.saveState] and [page:.reset] methods.
</p>
<h3>[property:Float rotateSpeed]</h3>
......@@ -233,7 +233,7 @@ controls.mouseButtons = {
<h3>[property:Vector3 target0]</h3>
<p>
Used internally by the [method:saveState] and [method:reset] methods.
Used internally by the [page:.saveState] and [page:.reset] methods.
</p>
<h3>[property:Vector3 target]</h3>
......@@ -255,7 +255,7 @@ controls.touches = {
<h3>[property:Float zoom0]</h3>
<p>
Used internally by the [method:saveState] and [method:reset] methods.
Used internally by the [page:.saveState] and [page:.reset] methods.
</p>
<h3>[property:Float zoomSpeed]</h3>
......@@ -282,6 +282,11 @@ controls.touches = {
Get the current vertical rotation, in radians.
</p>
<h3>[method:Float getDistance] ()</h3>
<p>
Returns the distance from the camera to the target.
</p>
<h3>[method:void listenToKeyEvents] ( [param:HTMLDOMElement domElement] )</h3>
<p>
Adds key event listeners to the given DOM element. *window* is a recommended argument for using this method.
......
......@@ -161,6 +161,14 @@
Should be called if the controls is no longer required.
</p>
<h3>[method:Raycaster getRaycaster] ()</h3>
<p>
Returns the [page:Raycaster] object that is used for user interaction. This object is shared between all instances of
TransformControls. If you set the [page:Object3D.layers .layers] property of the [name], you will also want to
set the [page:Raycaster.layers .layers] property on the [page:Raycaster] with a matching value, or else the [name]
won't work as expected.
</p>
<h3>[method:String getMode] ()</h3>
<p>
Returns the transformation mode.
......
......@@ -48,6 +48,9 @@
<li>version - string. Which version of Collada to export. The options are "1.4.1" or "1.5.0". Defaults to "1.4.1".</li>
<li>author - string. The name to include in the author field. Author field is excluded by default.</li>
<li>textureDirectory - string. The directory relative to the Collada file to save the textures to.</li>
<li>upAxis - string. Either Y_UP (default), Z_UP or X_UP.</li>
<li>unitName - string. Name of the unit. Can be any string, but could be for example "meter", "inch", or "parsec".</li>
<li>unitMeter - number. Length of the unit in meters.</li>
</ul>
</p>
<p>
......
......@@ -30,8 +30,12 @@
<ul>
<li>KHR_draco_mesh_compression</li>
<li>KHR_materials_clearcoat</li>
<li>KHR_materials_ior</li>
<li>KHR_materials_pbrSpecularGlossiness</li>
<li>KHR_materials_specular</li>
<li>KHR_materials_transmission</li>
<li>KHR_materials_unlit</li>
<li>KHR_materials_volume</li>
<li>KHR_mesh_quantization</li>
<li>KHR_lights_punctual<sup>1</sup></li>
<li>KHR_texture_basisu</li>
......
......@@ -23,116 +23,99 @@
<h2>Constructor</h2>
<h3>[name]( colormap, numberOfColors )</h3>
<h3>[name]( [param:String colormap], [param:Number count] )</h3>
<p>
colormap - optional argument that sets a colormap from predefined colormaps. Available colormaps are : "rainbow", "cooltowarm", "blackbody".
numberOfColors - optional argument that sets the number of colors used to represent the data array.
colormap - Sets a colormap from predefined colormaps. Available colormaps are : *rainbow*, *cooltowarm*, *blackbody*, *grayscale*. Default is *rainbow*.<br />
count - Sets the number of colors used to represent the data array. Default is *32*.
</p>
<h2>Properties</h2>
<h3>[property:Float minV]</h3>
<h3>[property:Array lut]</h3>
<p>
The minimum value to be represented with the lookup table. Default is 0.
The lookup table for the selected color map represented as an array of [page:Color]s.
</p>
<h3>[property:Float maxV]</h3>
<h3>[property:Array map]</h3>
<p>
The maximum value to be represented with the lookup table. Default is 1.
The currently selected color map. Default is the *rainbow* color map.
</p>
<h3>.[legend]</h3>
<h3>[property:Number minV]</h3>
<p>
The legend of the lookup table.
The minimum value to be represented with the lookup table. Default is *0*.
</p>
<h2>Methods</h2>
<h3>[method:null copy]( [param:Lut lut] ) [param:Lut this]</h3>
<p>
color — Lut to copy.
</p>
<h3>[property:Number maxV]</h3>
<p>
Copies given lut.
The maximum value to be represented with the lookup table. Default is *1*.
</p>
<h3>.setLegendOn [parameters]</h3>
<h3>[property:Number n]</h3>
<p>
parameters - { layout: value, position: { x: value, y: value, z: value }, dimensions: { width: value, height: value } }
layout — Horizontal or vertical layout. Default is vertical.<br />
position — The position x,y,z of the legend.<br />
dimensions — The dimensions (width and height) of the legend.<br />
</p>
<p>
Sets this Lut with the legend on.
The number of colors of the current selected color map. Default is *32*.
</p>
<h3>.setLegendOff</h3>
<h2>Methods</h2>
<h3>[method:null copy]( [param:Lut lut] ) [param:Lut this]</h3>
<p>
color — Lut to copy.
</p>
<p>
Sets this Lut with the legend off.
Copies the given lut.
</p>
<h3>.setLegendLabels [parameters, callback]</h3>
<h3>[method:Lut addColorMap]( [param:String name], [param:Array arrayOfColors] )</h3>
<p>
parameters - { fontsize: value, fontface: value, title: value, um: value, ticks: value, decimal: value, notation: value }
fontsize — Font size to be used for labels.<br />
fontface — Font type to be used for labels.<br />
title — The title of the legend.<br />
um — The unit of measurements of the legend.<br />
ticks — The number of ticks to be displayed.<br />
decimal — The number of decimals to be used for legend values.<br />
notation — Legend notation: standard (default) or scientific.<br />
callback — An optional callback to be used to format the legend labels.<br />
name — The name of the color map.<br />
arrayOfColors — An array of color values. Each value is an array holding a threshold and the actual color value as a hexadecimal number.
</p>
<p>
Sets the labels of the legend of this Lut.
Adds a color map to this [name] instance.
</p>
<h3>[method:Lut setMin]( [param:Float minV] )</h3>
<p>
minV — The minimum value to be represented with the lookup table.<br />
</p>
<h3>[method:HTMLCanvasElement createCanvas]()</h3>
<p>
Sets this Lut with the minimum value to be represented.
Creates a canvas in order to visualize the lookup table as a texture.
</p>
<h3>[method:Lut setMax]( [param:Float maxV] )</h3>
<h3>[method:Color getColor]( [param:Number alpha] )</h3>
<p>
maxV — The maximum value to be represented with the lookup table.<br />
value -- the data value to be displayed as a color.
</p>
<p>
Sets this Lut with the maximum value to be represented.
Returns an instance of [page:Color] for the given data value.
</p>
<h3>[method:Lut changeNumberOfColors]( [param:Float numberOfColors] )</h3>
<h3>[method:Lut setColorMap]( [param:String colormap], [param:Number count] )</h3>
<p>
numberOfColors — The number of colors to be used to represent the data array.<br />
colormap — The name of the color map.<br />
count — The number of colors. Default is *32*.
</p>
<p>
Sets this Lut with the number of colors to be used.
Configure the lookup table for the given color map and number of colors.
</p>
<h3>[method:Lut changeColorMap]( [param:Float colorMap] )</h3>
<h3>[method:Lut setMin]( [param:Number minV] )</h3>
<p>
colorMap — The name of the color map to be used to represent the data array.<br />
minV — The minimum value to be represented with the lookup table
</p>
<p>
Sets this Lut with the colormap to be used.
Sets this Lut with the minimum value to be represented.
</p>
<h3>[method:Lut addColorMap]( colorMapName, arrayOfColors )</h3>
<h3>[method:Lut setMax]( [param:Number maxV] )</h3>
<p>
Insert a new color map into the set of available color maps.
maxV — The maximum value to be represented with the lookup table.
</p>
<h3>[method:Lut getColor]( value ) [param:Lut this]</h3>
<p>
value -- the data value to be displayed as a color.
Sets this Lut with the maximum value to be represented.
</p>
<h3>[method:HTMLCanvasElement updateCanvas]( [param:HTMLCanvasElement canvas] )</h3>
<p>
Returns a [page:Color].
Updates the canvas with the [name]'s data.
</p>
<h2>Source</h2>
......
......@@ -212,7 +212,7 @@ controls.mouseButtons = {
<h3>[property:Vector3 position0]</h3>
<p>
해당 프로퍼티는 [method:saveState] 및 [method:reset] 메서드에서 내부적으로 사용합니다.
해당 프로퍼티는 [page:.saveState] 및 [page:.reset] 메서드에서 내부적으로 사용합니다.
</p>
<h3>[property:Float rotateSpeed]</h3>
......@@ -229,7 +229,7 @@ controls.mouseButtons = {
<h3>[property:Vector3 target0]</h3>
<p>
[method:saveState] 및 [method:rest] 메서드에서 내부적으로 사용합니다.
[page:.saveState] 및 [method:rest] 메서드에서 내부적으로 사용합니다.
</p>
<h3>[property:Vector3 target]</h3>
......@@ -250,7 +250,7 @@ controls.touches = {
<h3>[property:Float zoom0]</h3>
<p>
[method:saveState] 및 [method:reset] 메서드에서 내부적으로 사용합니다.
[page:.saveState] 및 [page:.reset] 메서드에서 내부적으로 사용합니다.
</p>
<h3>[property:Float zoomSpeed]</h3>
......@@ -278,6 +278,11 @@ controls.touches = {
라디안 단위로 현재 수직 회전값을 가져옵니다.
</p>
<h3>[method:Float getDistance] ()</h3>
<p>
Returns the distance from the camera to the target.
</p>
<h3>[method:void listenToKeyEvents] ( [param:HTMLDOMElement domElement] )</h3>
<p>
Adds key event listeners to the given DOM element. *window* is a recommended argument for using this method.
......@@ -290,7 +295,7 @@ controls.touches = {
<h3>[method:null saveState] ()</h3>
<p>
컨트롤의 현재 상태를 저장합니다. 나중에 [page:.rest]을 이용하여 현재 상태로 복구할 수 있습니다.
컨트롤의 현재 상태를 저장합니다. 나중에 [page:.reset]을 이용하여 현재 상태로 복구할 수 있습니다.
</p>
<h3>[method:Boolean update] ()</h3>
......
......@@ -159,6 +159,13 @@
컨트롤을 더이상 필요하지 않을 경우 호출해야 합니다.
</p>
<h3>[method:Raycaster getRaycaster] ()</h3>
<p>
사용자 상호 작용에 사용되는 [page:Raycaster] 객체를 반환합니다. 이 개체는의 모든 인스턴스간에 공유됩니다. TransformControls. [name] 의
[page:Object3D.layers .layers] 속성을 설정하면 [page:Raycaster] 의 [page:Raycaster.layers .layers] 속성을 일치하는
값으로 설정하거나 그렇지 않으면 [name] 예상대로 작동하지 않습니다.
</p>
<h3>[method:String getMode] ()</h3>
<p>
변환 모드를 반환합니다.
......
......@@ -214,7 +214,7 @@ controls.mouseButtons = {
<h3>[property:Vector3 position0]</h3>
<p>
由[method:saveState]和[method:reset]方法在内部使用。
由[page:.saveState]和[page:.reset]方法在内部使用。
</p>
<h3>[property:Float rotateSpeed]</h3>
......@@ -231,7 +231,7 @@ controls.mouseButtons = {
<h3>[property:Vector3 target0]</h3>
<p>
由[method:saveState]和[method:reset]方法在内部使用。
由[page:.saveState]和[page:.reset]方法在内部使用。
</p>
<h3>[property:Vector3 target]</h3>
......@@ -253,7 +253,7 @@ controls.touches = {
<h3>[property:Float zoom0]</h3>
<p>
由[method:saveState]和[method:reset]方法在内部使用。
由[page:.saveState]和[page:.reset]方法在内部使用。
</p>
<h3>[property:Float zoomSpeed]</h3>
......@@ -280,6 +280,11 @@ controls.touches = {
获得当前的垂直旋转,单位为弧度。
</p>
<h3>[method:Float getDistance] ()</h3>
<p>
Returns the distance from the camera to the target.
</p>
<h3>[method:void listenToKeyEvents] ( [param:HTMLDOMElement domElement] )</h3>
<p>
为指定的DOM元素添加按键监听。推荐将window作为指定的DOM元素。
......
......@@ -160,6 +160,13 @@
若不再需要该控制器,则应当调用此函数。
</p>
<h3>[method:Raycaster getRaycaster] ()</h3>
<p>
返回用于用户交互的 [page:Raycaster] 对象。 此对象在所有实例之间共享 变换控件。 如果您设置 [name] 的
[page:Object3D.layers .layers] 属性,您还需要 使用匹配值设置 [page:Raycaster] 上的
[page:Raycaster.layers .layers] 属性,否则设置 [name] 不会按预期工作。
</p>
<h3>[method:String getMode] ()</h3>
<p>
返回变换模式。
......
......@@ -28,8 +28,12 @@
<ul>
<li>KHR_draco_mesh_compression</li>
<li>KHR_materials_clearcoat</li>
<li>KHR_materials_ior</li>
<li>KHR_materials_pbrSpecularGlossiness</li>
<li>KHR_materials_specular</li>
<li>KHR_materials_transmission</li>
<li>KHR_materials_unlit</li>
<li>KHR_materials_volume</li>
<li>KHR_mesh_quantization</li>
<li>KHR_lights_punctual<sup>1</sup></li>
<li>KHR_texture_basisu</li>
......
......@@ -23,116 +23,99 @@
<h2>构造函数</h2>
<h3>[name]( colormap, numberOfColors )</h3>
<h3>[name]( [param:String colormap], [param:Number count] )</h3>
<p>
colormap - (可选)从预定义的颜色表中设置一个颜色表。可选值有:"rainbow"、 "cooltowarm"、 "blackbody"。
numberOfColors - (可选)设置用于表示数据数组的颜色数量。
colormap - Sets a colormap from predefined colormaps. Available colormaps are : *rainbow*, *cooltowarm*, *blackbody*, *grayscale*. Default is *rainbow*.<br />
count - Sets the number of colors used to represent the data array. Default is *32*.
</p>
<h2>属性</h2>
<h3>[property:Float minV]</h3>
<h3>[property:Array lut]</h3>
<p>
查找表所表示的最小值,默认为0。
The lookup table for the selected color map represented as an array of [page:Color]s.
</p>
<h3>[property:Float maxV]</h3>
<h3>[property:Array map]</h3>
<p>
查找表所表示的最小值,默认为1。
The currently selected color map. Default is the *rainbow* color map.
</p>
<h3>.[legend]</h3>
<h3>[property:Number minV]</h3>
<p>
查找表的图例。
The minimum value to be represented with the lookup table. Default is *0*.
</p>
<h2>方法</h2>
<h3>[method:null copy]( [param:Lut lut] ) [param:Lut this]</h3>
<h3>[property:Number maxV]</h3>
<p>
color — 要拷贝的 Lut。
</p>
<p>
拷贝给定的 Lut。
The maximum value to be represented with the lookup table. Default is *1*.
</p>
<h3>.setLegendOn [parameters]</h3>
<p>
parameters - { layout: value, position: { x: value, y: value, z: value }, dimensions: { width: value, height: value } }
layout — Horizontal or vertical layout. Default is vertical.<br />
position — The position x,y,z of the legend.<br />
dimensions — The dimensions (width and height) of the legend.<br />
</p>
<h3>[property:Number n]</h3>
<p>
Sets this Lut with the legend on.
The number of colors of the current selected color map. Default is *32*.
</p>
<h3>.setLegendOff</h3>
<h2>方法</h2>
<h3>[method:null copy]( [param:Lut lut] ) [param:Lut this]</h3>
<p>
color — Lut to copy.
</p>
<p>
Sets this Lut with the legend off.
Copies the given lut.
</p>
<h3>.setLegendLabels [parameters, callback]</h3>
<h3>[method:Lut addColorMap]( [param:String name], [param:Array arrayOfColors] )</h3>
<p>
parameters - { fontsize: value, fontface: value, title: value, um: value, ticks: value, decimal: value, notation: value }
fontsize — Font size to be used for labels.<br />
fontface — Font type to be used for labels.<br />
title — The title of the legend.<br />
um — The unit of measurements of the legend.<br />
ticks — The number of ticks to be displayed.<br />
decimal — The number of decimals to be used for legend values.<br />
notation — Legend notation: standard (default) or scientific.<br />
callback — An optional callback to be used to format the legend labels.<br />
name — The name of the color map.<br />
arrayOfColors — An array of color values. Each value is an array holding a threshold and the actual color value as a hexadecimal number.
</p>
<p>
Sets the labels of the legend of this Lut.
Adds a color map to this [name] instance.
</p>
<h3>[method:Lut setMin]( [param:Float minV] )</h3>
<h3>[method:HTMLCanvasElement createCanvas]()</h3>
<p>
minV — 查找表所表示的最小值。<br />
</p>
<p>
将查找表要表示的最小值设为该值。
Creates a canvas in order to visualize the lookup table as a texture.
</p>
<h3>[method:Lut setMax]( [param:Float maxV] )</h3>
<h3>[method:Color getColor]( [param:Number alpha] )</h3>
<p>
maxV — 查找表所表示的最小值。<br />
value -- the data value to be displayed as a color.
</p>
<p>
将查找表要表示的最大值设为该值。
Returns an instance of [page:Color] for the given data value.
</p>
<h3>[method:Lut changeNumberOfColors]( [param:Float numberOfColors] )</h3>
<h3>[method:Lut setColorMap]( [param:String colormap], [param:Number count] )</h3>
<p>
numberOfColors — 用于表示数据数组的颜色数量。<br />
colormap — The name of the color map.<br />
count — The number of colors. Default is *32*.
</p>
<p>
设置查找表中要使用的颜色的数量。
Configure the lookup table for the given color map and number of colors.
</p>
<h3>[method:Lut changeColorMap]( [param:Float colorMap] )</h3>
<h3>[method:Lut setMin]( [param:Number minV] )</h3>
<p>
colorMap — 用于表示数据数组的颜色表名称。<br />
minV — The minimum value to be represented with the lookup table
</p>
<p>
设置查找表的颜色表为传入的颜色表。
Sets this Lut with the minimum value to be represented.
</p>
<h3>[method:Lut addColorMap]( colorMapName, arrayOfColors )</h3>
<h3>[method:Lut setMax]( [param:Number maxV] )</h3>
<p>
插入一个新的颜色表到可用颜色表中。
maxV — The maximum value to be represented with the lookup table.
</p>
<h3>[method:Lut getColor]( value ) [param:Lut this]</h3>
<p>
value -- 作为颜色展示的数据值。
Sets this Lut with the maximum value to be represented.
</p>
<h3>[method:HTMLCanvasElement updateCanvas]( [param:HTMLCanvasElement canvas] )</h3>
<p>
返回一个[page:Color]。
Updates the canvas with the [name]'s data.
</p>
<h2>源码</h2>
......
......@@ -7,7 +7,6 @@
"Getting Started": {
"Creating a scene": "manual/en/introduction/Creating-a-scene",
"Installation": "manual/en/introduction/Installation",
"Browser support": "manual/en/introduction/Browser-support",
"WebGL compatibility check": "manual/en/introduction/WebGL-compatibility-check",
"How to run things locally": "manual/en/introduction/How-to-run-things-locally",
"Drawing lines": "manual/en/introduction/Drawing-lines",
......@@ -76,6 +75,7 @@
"Animation": "api/en/constants/Animation",
"Core": "api/en/constants/Core",
"CustomBlendingEquation": "api/en/constants/CustomBlendingEquations",
"BufferAttributeUsage": "api/en/constants/BufferAttributeUsage",
"Materials": "api/en/constants/Materials",
"Renderer": "api/en/constants/Renderer",
"Textures": "api/en/constants/Textures"
......@@ -448,7 +448,6 @@
"البدء": {
"إنشاء مشهد": "manual/ar/introduction/Creating-a-scene",
"التثبيت": "manual/ar/introduction/Installation",
"دعم المتصفح": "manual/ar/introduction/Browser-support",
"فحص توافق WebGL": "manual/ar/introduction/WebGL-compatibility-check",
"كيف تدير الأشياء محليًا": "manual/ar/introduction/How-to-run-things-locally",
"رسم خطوط": "manual/ar/introduction/Drawing-lines",
......@@ -520,7 +519,6 @@
"起步": {
"创建一个场景": "manual/zh/introduction/Creating-a-scene",
"安装": "manual/zh/introduction/Installation",
"浏览器支持": "manual/zh/introduction/Browser-support",
"WebGL兼容性检查": "manual/zh/introduction/WebGL-compatibility-check",
"如何在本地运行Three.js": "manual/zh/introduction/How-to-run-things-locally",
"画线": "manual/zh/introduction/Drawing-lines",
......@@ -955,7 +953,6 @@
"시작하기": {
"장면 만들기": "manual/ko/introduction/Creating-a-scene",
"설치": "manual/ko/introduction/Installation",
"브라우저 지원": "manual/ko/introduction/Browser-support",
"WebGL 호환성 검사": "manual/ko/introduction/WebGL-compatibility-check",
"로컬 환경에서 구동 방법": "manual/ko/introduction/How-to-run-things-locally",
"선 그리기": "manual/ko/introduction/Drawing-lines",
......@@ -1053,7 +1050,6 @@
"はじめてみましょう": {
"シーンの作成": "manual/ja/introduction/Creating-a-scene",
"インストールの方法": "manual/ja/introduction/Installation",
"サポートしているブラウザ": "manual/ja/introduction/Browser-support",
"WebGLの互換性の確認": "manual/ja/introduction/WebGL-compatibility-check",
"localで実行する方法": "manual/ja/introduction/How-to-run-things-locally",
"線を引く": "manual/ja/introduction/Drawing-lines",
......
<!DOCTYPE html>
<html lang="ar">
<head>
<meta charset="utf-8">
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body class="rtl">
<h1>([name]) دعم المتصفح</h1>
<h2>نظرة عامة</h2>
<div>
<p>
يمكن لـ Three.js استخدام WebGL لعرض المشاهد الخاصة بك على جميع المتصفحات الحديثة. بالنسبة إلى المتصفحات الأقدم ، وخاصة Internet Explorer 10 والإصدارات الأقدم ، قد تضطر إلى الرجوع إلى أحد المستعرضات الأخرى [link:https://github.com/mrdoob/three.js/tree/master/examples/jsm/renderers renderers] (CSS2DRenderer و CSS3DRenderer و SVGRenderer). بالإضافة إلى ذلك ، قد تضطر إلى تضمين بعض polyfills ، بالأخص إذا كنت تستخدم ملفات من المجلد [link:https://github.com/mrdoob/three.js/tree/master/examples /examples].
</p>
<p>
ملاحظة: إذا لم تكن بحاجة إلى دعم هذه المتصفحات القديمة ، فلا يوصى باستخدام برامج العارض الأخرى لأنها أبطأ وتدعم ميزات أقل من WebGLRenderer.
</p>
</div>
<h2>المتصفحات التي تدعم WebGL</h2>
<div>
<p>
Google Chrome 9+, Firefox 4+, Opera 15+, Safari 5.1+, Internet Explorer 11 و Microsoft Edge.<br/>
يمكنك العثور على المتصفحات التي تدعم WebGL في [link:https://caniuse.com/#feat=webgl Can I use WebGL].
</p>
</div>
<h2>ميزات لغة JavaScript أو واجهات الويب البرمجية المستخدمة في three.js</h2>
<div>
<p>
فيما يلي بعض الميزات المستخدمة في three.js. قد يتطلب بعض منهم polyfills إضافية.
</p>
<table>
<thead>
<tr>
<th>الخاصية</th>
<th>نطاق الاستخدم</th>
<th>الوحدات</th>
</tr>
</thead>
<tbody>
<tr>
<td>Typed Arrays</td>
<td>Source</td>
<td>BufferAttribute, BufferGeometry, etc.</td>
</tr>
<tr>
<td>Web Audio API</td>
<td>Source</td>
<td>Audio, AudioContext, AudioListener, etc.</td>
</tr>
<tr>
<td>WebXR Device API</td>
<td>Source</td>
<td>WebXRManager</td>
</tr>
<tr>
<td>Blob</td>
<td>Source</td>
<td>FileLoader, etc.</td>
</tr>
<tr>
<td>Promise</td>
<td>Examples</td>
<td>GLTFLoader, DRACOLoader, BasisTextureLoader, GLTFExporter, VRButton, ARButton, etc.</td>
</tr>
<tr>
<td>Fetch</td>
<td>Examples</td>
<td>ImageBitmapLoader, etc.</td>
</tr>
<tr>
<td>File API</td>
<td>Examples</td>
<td>GLTFExporter, etc.</td>
</tr>
<tr>
<td>URL API</td>
<td>Examples</td>
<td>GLTFLoader, etc.</td>
</tr>
<tr>
<td>Pointer Lock API</td>
<td>Examples</td>
<td>PointerLockControls</td>
</tr>
</tbody>
</table>
</div>
<h2>Polyfills</h2>
<div>
<p>فقط قم باستيراد polyfills بناءً على متطلباتك. إذا أخذنا IE9 كمثال ، فأنت بحاجة إلى ملء هذه الميزات على الأقل:</p>
<ul>
<li>Typed Arrays</li>
<li>Blob</li>
</ul>
</div>
<h3>مقترح polyfills</h3>
<div>
<ul>
<li>
[link:https://github.com/zloirock/core-js core-js]
</li>
<li>
[link:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js typedarray.js]
</li>
<li>
[link:https://github.com/stefanpenner/es6-promise/ ES6-Promise]
</li>
<li>
[link:https://github.com/eligrey/Blob.js Blob.js]
</li>
<li>
[link:https://github.com/github/fetch fetch]
</li>
</ul>
</div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h2>Overview</h2>
<div>
<p>
Three.js can use WebGL to render your scenes on all modern browsers. For older browsers, especially Internet Explorer 10 and below, you may have to fallback to one of the other [link:https://github.com/mrdoob/three.js/tree/master/examples/jsm/renderers renderers] (CSS2DRenderer, CSS3DRenderer, SVGRenderer). Additionally, you may have to include some polyfills, especially if you are using files from the [link:https://github.com/mrdoob/three.js/tree/master/examples /examples] folder.
</p>
<p>
Note: if you don't need to support these old browsers, then it is not recommended to use the other renderers as they are slower and support less features than the WebGLRenderer.
</p>
</div>
<h2>Browsers that support WebGL</h2>
<div>
<p>
Google Chrome 9+, Firefox 4+, Opera 15+, Safari 5.1+, Internet Explorer 11 and Microsoft Edge. You can find which browsers support WebGL at [link:https://caniuse.com/#feat=webgl Can I use WebGL].
</p>
</div>
<h2>JavaScript Language Features or Web APIs Used in three.js</h2>
<div>
<p>
Here are some features used in three.js. Some of them may require additional polyfills.
</p>
<table>
<thead>
<tr>
<th>Feature</th>
<th>Use Scope</th>
<th>Modules</th>
</tr>
</thead>
<tbody>
<tr>
<td>Typed Arrays</td>
<td>Source</td>
<td>BufferAttribute, BufferGeometry, etc.</td>
</tr>
<tr>
<td>Web Audio API</td>
<td>Source</td>
<td>Audio, AudioContext, AudioListener, etc.</td>
</tr>
<tr>
<td>WebXR Device API</td>
<td>Source</td>
<td>WebXRManager</td>
</tr>
<tr>
<td>Blob</td>
<td>Source</td>
<td>FileLoader, etc.</td>
</tr>
<tr>
<td>Promise</td>
<td>Examples</td>
<td>GLTFLoader, DRACOLoader, BasisTextureLoader, GLTFExporter, VRButton, ARButton, etc.</td>
</tr>
<tr>
<td>Fetch</td>
<td>Examples</td>
<td>ImageBitmapLoader, etc.</td>
</tr>
<tr>
<td>File API</td>
<td>Examples</td>
<td>GLTFExporter, etc.</td>
</tr>
<tr>
<td>URL API</td>
<td>Examples</td>
<td>GLTFLoader, etc.</td>
</tr>
<tr>
<td>Pointer Lock API</td>
<td>Examples</td>
<td>PointerLockControls</td>
</tr>
</tbody>
</table>
</div>
<h2>Polyfills</h2>
<div>
<p>Just import polyfills based on your requirements. Taking IE9 as an example, you need to polyfill at least these features:</p>
<ul>
<li>Typed Arrays</li>
<li>Blob</li>
</ul>
</div>
<h3>Suggested polyfills</h3>
<div>
<ul>
<li>
[link:https://github.com/zloirock/core-js core-js]
</li>
<li>
[link:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js typedarray.js]
</li>
<li>
[link:https://github.com/stefanpenner/es6-promise/ ES6-Promise]
</li>
<li>
[link:https://github.com/eligrey/Blob.js Blob.js]
</li>
<li>
[link:https://github.com/github/fetch fetch]
</li>
</ul>
</div>
</body>
</html>
......@@ -35,7 +35,7 @@
<li>[link:https://github.com/vanruesc/postprocessing postprocessing]</li>
</ul>
<h3>Intersection and Raycasting Performance</h3>
<h3>Intersection and Raycast Performance</h3>
<ul>
<li>[link:https://github.com/gkjohnson/three-mesh-bvh three-mesh-bvh]</li>
......@@ -52,7 +52,13 @@
<li>[link:https://github.com/gkjohnson/urdf-loaders/tree/master/javascript urdf-loader]</li>
<li>[link:https://github.com/NASA-AMMOS/3DTilesRendererJS 3d-tiles-renderer-js]</li>
<li>[link:https://github.com/kaisalmen/WWOBJLoader WebWorker OBJLoader]</li>
<li>[link:https://github.com/agviegas/IFC.js IFC.js]</li>
<li>[link:https://github.com/IFCjs/web-ifc-three IFC.js]</li>
</ul>
<h3>Geometry</h3>
<ul>
<li>[link:https://github.com/spite/THREE.MeshLine THREE.MeshLine]</li>
</ul>
<h3>3D Text and Layout</h3>
......@@ -68,7 +74,6 @@
<li>[link:https://github.com/creativelifeform/three-nebula three-nebula]</li>
</ul>
<h3>Inverse Kinematics</h3>
<ul>
......
......@@ -13,7 +13,7 @@
<p class="desc">
three.jsのアニメーションシステムの中では、モデルの様々なプロパティをアニメーション化できます。
例えば、装飾を行なったモデル([page:SkinnedMesh skinned and rigged model])の骨格や、[page:Geometry.morphTargets morphTargets]、異なるマテリアルの要素(色、不透明度、有無)、可視性、変形などを操作できます。
例えば、装飾を行なったモデル([page:SkinnedMesh skinned and rigged model])の骨格や、morphTargets、異なるマテリアルの要素(色、不透明度、有無)、可視性、変形などを操作できます。
アニメーションの要素は、フェードインやフェードアウト、クロスフェード、重ね合わせが可能です。
同一のオブジェクトであっても異なるものであっても、異なるアニメーションの比重やタイムスケールは独立して変更出来ます。また、同じオブジェクトでも、異なるオブジェクトでもアニメーションは同期出来ます。<br /><br />
......@@ -39,7 +39,7 @@
こういった*AnimationClip*の中では、アニメーションの要素のデータは別の[page:KeyframeTrack]に保存されています。キャラクターオブジェクトが骨格を持っていると仮定すると、あるキートラックフレームは腕の下の方の骨の、位置の時間変化のデータを保存し、別のキートラックは同じ骨の回転成分の動きのデータを保存し、また別のキートラックは他の骨の位置や回転、スケールの変化といったデータを保存します。AnimationClipは、このようなたくさんのトラックで構成できることがわかります。
モデルが[page:Geometry.morphTargets morph targets]を持っていると仮定すると(例えば、友好的な顔から怒った顔にモーフィングするような場合)、それぞれのトラックは特定のモーフィングターゲットの[page:Mesh.morphTargetInfluences influence]がclipのパフォーマンス中にどうやって変化するかについての情報を持っています。
モデルがmorph targetsを持っていると仮定すると(例えば、友好的な顔から怒った顔にモーフィングするような場合)、それぞれのトラックは特定のモーフィングターゲットの[page:Mesh.morphTargetInfluences influence]がclipのパフォーマンス中にどうやって変化するかについての情報を持っています。
</p>
......
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<h2>概要</h2>
<div>
<p>
モダンなブラウザ上であれば、Three.jsはWebGLを使ってsceneを描画出来ます。古いブラウザ(特にInternet Explore 10以下)では、他の[link:https://github.com/mrdoob/three.js/tree/master/examples/jsm/renderers renderers] (CSS2DRenderer, CSS3DRenderer, SVGRenderer)に後方互換する必要があるでしょう。さらに、特に [link:https://github.com/mrdoob/three.js/tree/master/examples /examples] フォルダのファイルを使用している場合は、いくつかのpolyfillを含める必要がある可能性があります。
</p>
<p>
注意事項: もし古いブラウザをサポートする必要がないなら、WebGLRenderer以外を使うことはおすすめしません。というのも、他のrendererは遅い上に、サポートしている機能が少ないからです。
</p>
</div>
<h2>WebGLをサポートしているブラウザ</h2>
<div>
<p>
Google Chrome 9以上、Firefox 4以上、Opera 15以上、Safari 5.1以上、Internet Explore 11以上、もしくはMicrosoft Edge。
どのブラウザがWebGLをサポートしているのかは[link:https://caniuse.com/#feat=webgl Can I use WebGL]を確認してください。
</p>
</div>
<h2>three.jsで使用されるJavaScriptの機能とWeb APIs</h2>
<div>
<p>
three.jsで使われる機能の中には追加のpolyfillsが必要になるものがあります。
</p>
<table>
<thead>
<tr>
<th>機能</th>
<th>スコープ</th>
<th>モジュール</th>
</tr>
</thead>
<tbody>
<tr>
<td>Typed Arrays</td>
<td>Source</td>
<td>BufferAttribute, BufferGeometry, etc.</td>
</tr>
<tr>
<td>Web Audio API</td>
<td>Source</td>
<td>Audio, AudioContext, AudioListener, etc.</td>
</tr>
<tr>
<td>WebXR Device API</td>
<td>Source</td>
<td>WebXRManager</td>
</tr>
<tr>
<td>Blob</td>
<td>Source</td>
<td>FileLoader, etc.</td>
</tr>
<tr>
<td>Promise</td>
<td>Examples</td>
<td>GLTFLoader, DRACOLoader, BasisTextureLoader, GLTFExporter, VRButton, ARButton, etc.</td>
</tr>
<tr>
<td>Fetch</td>
<td>Examples</td>
<td>ImageBitmapLoader, etc.</td>
</tr>
<tr>
<td>File API</td>
<td>Examples</td>
<td>GLTFExporter, etc.</td>
</tr>
<tr>
<td>URL API</td>
<td>Examples</td>
<td>GLTFLoader, etc.</td>
</tr>
<tr>
<td>Pointer Lock API</td>
<td>Examples</td>
<td>PointerLockControls</td>
</tr>
</tbody>
</table>
</div>
<h2>Polyfills</h2>
<div>
<p>
要件に応じてポリフィルをインポートするだけです。例えば、IE9の場合は少なくとも以下の機能を追加する必要があります。
</p>
<ul>
<li>Typed Arrays</li>
<li>Blob</li>
</ul>
</div>
<h3>おすすめのpolyfills</h3>
<div>
<ul>
<li>
[link:https://github.com/zloirock/core-js core-js]
</li>
<li>
[link:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js typedarray.js]
</li>
<li>
[link:https://github.com/stefanpenner/es6-promise/ ES6-Promise]
</li>
<li>
[link:https://github.com/eligrey/Blob.js Blob.js]
</li>
<li>
[link:https://github.com/github/fetch fetch]
</li>
</ul>
</div>
</body>
</html>
......@@ -126,33 +126,6 @@ line.geometry.computeBoundingSphere();
</div>
<h2>Geometry</h2>
<div>
<p>
下記に示してあるフラグはさまざまなジオメトリの要素の更新をコントロールします。 更新にはコストがかかるので、更新が必要な要素のみを、更新するように設定してください。 バッファが変化すると、自動的にこれらのフラグはflaseにリセットされます。 バッファを更新し続けたいのであれば、このフラグをtrueに設定し続ける必要があります。 これは[page:Geometry]にのみ適用されて、[page:BufferGeometry]には適用されないことに注意してください。
</p>
<code>
const geometry = new THREE.Geometry();
geometry.verticesNeedUpdate = true;
geometry.elementsNeedUpdate = true;
geometry.morphTargetsNeedUpdate = true;
geometry.uvsNeedUpdate = true;
geometry.normalsNeedUpdate = true;
geometry.colorsNeedUpdate = true;
geometry.tangentsNeedUpdate = true;
</code>
<p>
[link:https://github.com/mrdoob/three.js/releases/tag/r66 r66]以前のバージョンでは、メッシュは<em>dynamic</em>フラグを有効にする必要があります。これは内部で型付き配列を保持するために必要になります。
</p>
<code>
// removed after r66
geometry.dynamic = true;
</code>
</div>
<h2>Materials</h2>
<div>
<p>
......
......@@ -36,7 +36,7 @@
<li>[link:https://github.com/vanruesc/postprocessing postprocessing]</li>
</ul>
<h3>Intersection and Raycasting Performance</h3>
<h3>Intersection and Raycast Performance</h3>
<ul>
<li>[link:https://github.com/gkjohnson/three-mesh-bvh three-mesh-bvh]</li>
......@@ -52,7 +52,13 @@
<li>[link:https://github.com/gkjohnson/urdf-loaders/tree/master/javascript urdf-loader]</li>
<li>[link:https://github.com/NASA-AMMOS/3DTilesRendererJS 3d-tiles-renderer-js]</li>
<li>[link:https://github.com/kaisalmen/WWOBJLoader WebWorker OBJLoader]</li>
<li>[link:https://github.com/agviegas/IFC.js IFC.js]</li>
<li>[link:https://github.com/IFCjs/web-ifc-three IFC.js]</li>
</ul>
<h3>Geometry</h3>
<ul>
<li>[link:https://github.com/spite/THREE.MeshLine THREE.MeshLine]</li>
</ul>
<h3>3D Text and Layout</h3>
......@@ -68,7 +74,6 @@
<li>[link:https://github.com/creativelifeform/three-nebula three-nebula]</li>
</ul>
<h3>Inverse Kinematics</h3>
<ul>
......@@ -93,4 +98,4 @@
</body>
</html>
\ No newline at end of file
</html>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="utf-8">
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>브라우저 지원([name])</h1>
<h2>개요</h2>
<div>
<p>
Three.js 는 WebGL을 통해 대부분의 현대 브라우저에서 scene을 렌더링할 수 있습니다. 오래된 브라우저, 특히 Internet Explorer 10 이하 버전에서는 다른
[link:https://github.com/mrdoob/three.js/tree/master/examples/jsm/renderers 렌더러] (CSS2DRenderer,
CSS3DRenderer, SVGRenderer)를 사용해야 합니다. 또한,
polyfills를 몇가지 포함해야 할 수도 있는데 [link:https://github.com/mrdoob/three.js/tree/master/examples /examples] 폴더의
파일을 불러올때에는 필수입니다.
</p>
<p>
오래된 브라우저를 지원할 필요가 없다면, 다른 렌더러를 사용하는 것은 추천하지 않습니다. WebGLRenderer보다 느릴뿐더러 더 적은 기능을 지원하기 때문입니다.
</p>
</div>
<h2>WebGL지원 웹 브라우저</h2>
<div>
<p>
Google Chrome 9+, Firefox 4+, Opera 15+, Safari 5.1+, Internet Explorer 11 및 Microsoft Edge. [link:https://caniuse.com/#feat=webgl Can I use WebGL]에서 어떤 브라우저들이 지원하는지 확인해볼 수 있습니다.
</p>
</div>
<h2>JavaScript 언어 특성 및 three.js에서 사용된 Web API</h2>
<div>
<p>
three.js에서 사용된 특성들은 다음과 같습니다. 이 중 몇개는 추가로 polyfills가 필요합니다.
</p>
<table>
<thead>
<tr>
<th>특성</th>
<th>사용 범위</th>
<th>모듈</th>
</tr>
</thead>
<tbody>
<tr>
<td>Typed Arrays</td>
<td>Source</td>
<td>BufferAttribute, BufferGeometry, etc.</td>
</tr>
<tr>
<td>Web Audio API</td>
<td>Source</td>
<td>Audio, AudioContext, AudioListener, etc.</td>
</tr>
<tr>
<td>WebXR Device API</td>
<td>Source</td>
<td>WebXRManager</td>
</tr>
<tr>
<td>Blob</td>
<td>Source</td>
<td>FileLoader, etc.</td>
</tr>
<tr>
<td>Promise</td>
<td>Examples</td>
<td>GLTFLoader, DRACOLoader, BasisTextureLoader, GLTFExporter, VRButton, ARButton, etc.</td>
</tr>
<tr>
<td>Fetch</td>
<td>Examples</td>
<td>ImageBitmapLoader, etc.</td>
</tr>
<tr>
<td>File API</td>
<td>Examples</td>
<td>GLTFExporter, etc.</td>
</tr>
<tr>
<td>URL API</td>
<td>Examples</td>
<td>GLTFLoader, etc.</td>
</tr>
<tr>
<td>Pointer Lock API</td>
<td>Examples</td>
<td>PointerLockControls</td>
</tr>
</tbody>
</table>
</div>
<h2>Polyfills</h2>
<div>
<p>필요에 따라 polyfills을 import 하세요. IE9를 예로들면 적어도 다음과 같은 polyfills가 필요할 것입니다.
these features:</p>
<ul>
<li>Typed Arrays</li>
<li>Blob</li>
</ul>
</div>
<h3>추천 polyfills</h3>
<div>
<ul>
<li>
[link:https://github.com/zloirock/core-js core-js]
</li>
<li>
[link:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js typedarray.js]
</li>
<li>
[link:https://github.com/stefanpenner/es6-promise/ ES6-Promise]
</li>
<li>
[link:https://github.com/eligrey/Blob.js Blob.js]
</li>
<li>
[link:https://github.com/github/fetch fetch]
</li>
</ul>
</div>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="utf-8">
<base href="../../../" />
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>浏览器支持([name])</h1>
<h2>总览</h2>
<div>
<p>
在所有现代浏览器中,Three.js可以使用WebGL来渲染场景。对于较旧的浏览器,特别是Internet Explorer 10或者更低版本浏览器,你将需要回落到其它[link:https://github.com/mrdoob/three.js/tree/master/examples/jsm/renderers renderers](CSS2DRenderer、CSS3DRenderer、SVGRenderer)。此外,你或许不得不包含一些额外的“填充物”来解决兼容性问题,特别是当你使用[link:https://github.com/mrdoob/three.js/tree/master/examples /examples]目录中的文件时。
</p>
<p>
注意:如果你并不需要支持较旧的浏览器,那就不推荐使用其他渲染器来进行渲染,因为与WebGLRenderer相比,其它渲染器渲染较慢,并且不支持WebGL的诸多特性。
</p>
</div>
<h2>支持WebGL的浏览器</h2>
<div>
<p>
Google Chrome 9+、Firefox 4+、Opera 15+、Safari 5.1+、Internet Explorer 11 和 Microsoft Edge。你可以点击[link:https://caniuse.com/#feat=webgl Can I use WebGL]来查阅各个浏览器对WebGL的支持性。
</p>
</div>
<h2>
在Three.js中所使用到的JavaScript语言特性或者Web API
</h2>
<div>
<p>
这里是一些在Three.js中使用到的特性,其中的一部分需要额外的“填充物”(Polyfills)来解决兼容性问题。
</p>
<table>
<thead>
<tr>
<th>特性</th>
<th>适用范围</th>
<th>模块</th>
</tr>
</thead>
<tbody>
<tr>
<td>Typed Arrays</td>
<td>Source</td>
<td>BufferAttribute, BufferGeometry, etc.</td>
</tr>
<tr>
<td>Web Audio API</td>
<td>Source</td>
<td>Audio, AudioContext, AudioListener, etc.</td>
</tr>
<tr>
<td>WebXR Device API</td>
<td>Source</td>
<td>WebXRManager</td>
</tr>
<tr>
<td>Blob</td>
<td>Source</td>
<td>FileLoader, etc.</td>
</tr>
<tr>
<td>Promise</td>
<td>Examples</td>
<td>GLTFLoader, DRACOLoader, BasisTextureLoader, GLTFExporter, VRButton, ARButton, etc.</td>
</tr>
<tr>
<td>Fetch</td>
<td>Examples</td>
<td>ImageBitmapLoader, etc.</td>
</tr>
<tr>
<td>File API</td>
<td>Examples</td>
<td>GLTFExporter, etc.</td>
</tr>
<tr>
<td>URL API</td>
<td>Examples</td>
<td>GLTFLoader, etc.</td>
</tr>
<tr>
<td>Pointer Lock API</td>
<td>Examples</td>
<td>PointerLockControls</td>
</tr>
</tbody>
</table>
</div>
<h2>关于用于解决兼容性问题的“填充物”</h2>
<div>
<p>根据你的需求,引入相关的“填充物”即可。以IE9为例,你至少需要来使用“填充物”完成以下的功能。</p>
<ul>
<li>Typed Arrays</li>
<li>Blob</li>
</ul>
</div>
<h3>建议的“填充物”</h3>
<div>
<ul>
<li>
[link:https://github.com/zloirock/core-js core-js]
</li>
<li>
[link:https://github.com/inexorabletash/polyfill/blob/master/typedarray.js typedarray.js]
</li>
<li>
[link:https://github.com/stefanpenner/es6-promise/ ES6-Promise]
</li>
<li>
[link:https://github.com/eligrey/Blob.js Blob.js]
</li>
<li>
[link:https://github.com/github/fetch fetch]
</li>
</ul>
</div>
</body>
</html>
......@@ -458,8 +458,8 @@
const data = {
radius: 15,
widthSegments: 8,
heightSegments: 6,
widthSegments: 32,
heightSegments: 16,
phiStart: 0,
phiLength: twoPi,
thetaStart: 0,
......@@ -479,7 +479,7 @@
const folder = gui.addFolder( 'THREE.SphereGeometry' );
folder.add( data, 'radius', 1, 30 ).onChange( generateGeometry );
folder.add( data, 'widthSegments', 3, 32 ).step( 1 ).onChange( generateGeometry );
folder.add( data, 'widthSegments', 3, 64 ).step( 1 ).onChange( generateGeometry );
folder.add( data, 'heightSegments', 2, 32 ).step( 1 ).onChange( generateGeometry );
folder.add( data, 'phiStart', 0, twoPi ).onChange( generateGeometry );
folder.add( data, 'phiLength', 0, twoPi ).onChange( generateGeometry );
......
......@@ -172,6 +172,7 @@
signals.objectRemoved.add( saveState );
signals.materialChanged.add( saveState );
signals.sceneBackgroundChanged.add( saveState );
signals.sceneEnvironmentChanged.add( saveState );
signals.sceneFogChanged.add( saveState );
signals.sceneGraphChanged.add( saveState );
signals.scriptChanged.add( saveState );
......
......@@ -132,6 +132,7 @@ Editor.prototype = {
this.scene.name = scene.name;
this.scene.background = scene.background;
this.scene.environment = scene.environment;
this.scene.fog = scene.fog;
this.scene.userData = JSON.parse( JSON.stringify( scene.userData ) );
......
......@@ -192,8 +192,7 @@ function Loader( editor ) {
} else {
var material = new THREE.PointsMaterial( { size: 0.01 } );
if ( geometry.hasAttribute( 'color' ) === true ) material.vertexColors = true;
material.vertexColors = geometry.hasAttribute( 'color' );
object = new THREE.Points( geometry, material );
object.name = filename;
......@@ -354,13 +353,12 @@ function Loader( editor ) {
var { IFCLoader } = await import( '../../examples/jsm/loaders/IFCLoader.js' );
var loader = new IFCLoader();
loader.setWasmPath( '../../examples/jsm/loaders/ifc/' );
var scene = await loader.parse( event.target.result );
loader.ifcManager.setWasmPath( '../../examples/jsm/loaders/ifc/' );
scene.name = filename;
var model = await loader.parse( event.target.result );
model.mesh.name = filename;
editor.execute( new AddObjectCommand( editor, scene ) );
editor.execute( new AddObjectCommand( editor, model.mesh ) );
}, false );
reader.readAsArrayBuffer( file );
......@@ -385,6 +383,31 @@ function Loader( editor ) {
break;
case 'ldr':
case 'mpd':
reader.addEventListener( 'load', async function ( event ) {
var { LDrawLoader } = await import( '../../examples/jsm/loaders/LDrawLoader.js' );
var loader = new LDrawLoader();
loader.fileMap = {}; // TODO Uh...
loader.setPath( '../../examples/models/ldraw/officialLibrary/' );
loader.parse( event.target.result, undefined, function ( group ) {
group.name = filename;
// Convert from LDraw coordinates: rotate 180 degrees around OX
group.rotation.x = Math.PI;
editor.execute( new AddObjectCommand( editor, group ) );
} );
}, false );
reader.readAsText( file );
break;
case 'md2':
reader.addEventListener( 'load', async function ( event ) {
......@@ -394,10 +417,7 @@ function Loader( editor ) {
var { MD2Loader } = await import( '../../examples/jsm/loaders/MD2Loader.js' );
var geometry = new MD2Loader().parse( contents );
var material = new THREE.MeshStandardMaterial( {
morphTargets: true,
morphNormals: true
} );
var material = new THREE.MeshStandardMaterial();
var mesh = new THREE.Mesh( geometry, material );
mesh.mixer = new THREE.AnimationMixer( mesh );
......@@ -438,12 +458,26 @@ function Loader( editor ) {
var { PLYLoader } = await import( '../../examples/jsm/loaders/PLYLoader.js' );
var geometry = new PLYLoader().parse( contents );
var material = new THREE.MeshStandardMaterial();
var object;
var mesh = new THREE.Mesh( geometry, material );
mesh.name = filename;
if ( geometry.index !== null ) {
editor.execute( new AddObjectCommand( editor, mesh ) );
var material = new THREE.MeshStandardMaterial();
object = new THREE.Mesh( geometry, material );
object.name = filename;
} else {
var material = new THREE.PointsMaterial( { size: 0.01 } );
material.vertexColors = geometry.hasAttribute( 'color' );
object = new THREE.Points( geometry, material );
object.name = filename;
}
editor.execute( new AddObjectCommand( editor, object ) );
}, false );
reader.readAsArrayBuffer( file );
......
......@@ -205,7 +205,7 @@ function MenubarAdd( editor ) {
option.setTextContent( strings.getKey( 'menubar/add/sphere' ) );
option.onClick( function () {
var geometry = new THREE.SphereGeometry( 1, 8, 6, 0, Math.PI * 2, 0, Math.PI );
var geometry = new THREE.SphereGeometry( 1, 32, 16, 0, Math.PI * 2, 0, Math.PI );
var mesh = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial() );
mesh.name = 'Sphere';
......
......@@ -54,6 +54,18 @@ function MenubarHelp( editor ) {
} );
options.add( option );
// Manual
var option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/help/manual' ) );
option.onClick( function () {
window.open( 'https://github.com/mrdoob/three.js/wiki/Editor-Manual', '_blank' );
} );
options.add( option );
return container;
}
......
import { UICheckbox, UIRow, UIText } from './libs/ui.js';
import { SetMaterialValueCommand } from './commands/SetMaterialValueCommand.js';
function SidebarMaterialBooleanProperty( editor, property, name ) {
const signals = editor.signals;
const container = new UIRow();
container.add( new UIText( name ).setWidth( '90px' ) );
const boolean = new UICheckbox().setLeft( '100px' ).onChange( onChange );
container.add( boolean );
let object = null;
let material = null;
function onChange() {
if ( material[ property ] !== boolean.getValue() ) {
editor.execute( new SetMaterialValueCommand( editor, object, property, boolean.getValue(), 0 /* TODO: currentMaterialSlot */ ) );
}
}
function update() {
if ( object === null ) return;
if ( object.material === undefined ) return;
material = object.material;
if ( property in material ) {
boolean.setValue( material[ property ] );
container.setDisplay( '' );
} else {
container.setDisplay( 'none' );
}
}
//
signals.objectSelected.add( function ( selected ) {
object = selected;
update();
} );
signals.materialChanged.add( update );
return container;
}
export { SidebarMaterialBooleanProperty };
import { UIColor, UINumber, UIRow, UIText } from './libs/ui.js';
import { SetMaterialColorCommand } from './commands/SetMaterialColorCommand.js';
import { SetMaterialValueCommand } from './commands/SetMaterialValueCommand.js';
function SidebarMaterialColorProperty( editor, property, name ) {
const signals = editor.signals;
const container = new UIRow();
container.add( new UIText( name ).setWidth( '90px' ) );
const color = new UIColor().onInput( onChange );
container.add( color );
let intensity;
if ( property === 'emissive' ) {
intensity = new UINumber().setWidth( '30px' ).onChange( onChange );
container.add( intensity );
}
let object = null;
let material = null;
function onChange() {
if ( material[ property ].getHex() !== color.getHexValue() ) {
editor.execute( new SetMaterialColorCommand( editor, object, property, color.getHexValue(), 0 /* TODO: currentMaterialSlot */ ) );
}
if ( intensity !== undefined ) {
if ( material[ `${ property }Intensity` ] !== intensity.getValue() ) {
editor.execute( new SetMaterialValueCommand( editor, object, `${ property }Intensity`, intensity.getValue(), /* TODO: currentMaterialSlot*/ 0 ) );
}
}
}
function update() {
if ( object === null ) return;
if ( object.material === undefined ) return;
material = object.material;
if ( property in material ) {
color.setHexValue( material[ property ].getHexString() );
if ( intensity !== undefined ) {
intensity.setValue( material[ `${ property }Intensity` ] );
}
container.setDisplay( '' );
} else {
container.setDisplay( 'none' );
}
}
//
signals.objectSelected.add( function ( selected ) {
object = selected;
update();
} );
signals.materialChanged.add( update );
return container;
}
export { SidebarMaterialColorProperty };
import { UIRow, UISelect, UIText } from './libs/ui.js';
import { SetMaterialValueCommand } from './commands/SetMaterialValueCommand.js';
function SidebarMaterialConstantProperty( editor, property, name, options ) {
const signals = editor.signals;
const container = new UIRow();
container.add( new UIText( name ).setWidth( '90px' ) );
const constant = new UISelect().setOptions( options ).onChange( onChange );
container.add( constant );
let object = null;
let material = null;
function onChange() {
const value = parseInt( constant.getValue() );
if ( material[ property ] !== value ) {
editor.execute( new SetMaterialValueCommand( editor, object, property, value, 0 /* TODO: currentMaterialSlot */ ) );
}
}
function update() {
if ( object === null ) return;
if ( object.material === undefined ) return;
material = object.material;
if ( property in material ) {
constant.setValue( material[ property ] );
container.setDisplay( '' );
} else {
container.setDisplay( 'none' );
}
}
//
signals.objectSelected.add( function ( selected ) {
object = selected;
update();
} );
signals.materialChanged.add( update );
return container;
}
export { SidebarMaterialConstantProperty };
import * as THREE from '../../build/three.module.js';
import { UICheckbox, UINumber, UIRow, UIText } from './libs/ui.js';
import { UITexture } from './libs/ui.three.js';
import { SetMaterialMapCommand } from './commands/SetMaterialMapCommand.js';
import { SetMaterialValueCommand } from './commands/SetMaterialValueCommand.js';
import { SetMaterialVectorCommand } from './commands/SetMaterialVectorCommand.js';
function SidebarMaterialMapProperty( editor, property, name ) {
const signals = editor.signals;
const container = new UIRow();
container.add( new UIText( name ).setWidth( '90px' ) );
const enabled = new UICheckbox( false ).setMarginRight( '8px' ).onChange( onChange );
container.add( enabled );
const map = new UITexture().onChange( onMapChange );
container.add( map );
const mapType = property.replace( 'Map', '' );
let intensity;
if ( property === 'aoMap' ) {
intensity = new UINumber().setWidth( '30px' ).onChange( onIntensityChange );
container.add( intensity );
}
let scale;
if ( property === 'bumpMap' || property === 'displacementMap' ) {
scale = new UINumber().setWidth( '30px' ).onChange( onScaleChange );
container.add( scale );
}
let scaleX, scaleY;
if ( property === 'normalMap' || property === 'clearcoatNormalMap' ) {
scaleX = new UINumber().setWidth( '30px' ).onChange( onScaleXYChange );
container.add( scaleX );
scaleY = new UINumber().setWidth( '30px' ).onChange( onScaleXYChange );
container.add( scaleY );
}
let object = null;
let material = null;
function onChange() {
const newMap = enabled.getValue() ? map.getValue() : null;
if ( material[ 'property' ] !== newMap ) {
const geometry = object.geometry;
if ( newMap !== null && geometry.isBufferGeometry && geometry.attributes.uv === undefined ) {
console.warn( 'Geometry doesn\'t have uvs:', geometry );
}
editor.execute( new SetMaterialMapCommand( editor, object, property, newMap, 0 /* TODO: currentMaterialSlot */ ) );
}
}
function onMapChange( texture ) {
if ( texture !== null ) {
if ( texture.isDataTexture !== true && texture.encoding !== THREE.sRGBEncoding ) {
texture.encoding = THREE.sRGBEncoding;
material.needsUpdate = true;
}
}
enabled.setDisabled( false );
onChange();
}
function onIntensityChange() {
if ( material[ `${ property }Intensity` ] !== intensity.getValue() ) {
editor.execute( new SetMaterialValueCommand( editor, object, `${ property }Intensity`, intensity.getValue(), 0 /* TODO: currentMaterialSlot */ ) );
}
}
function onScaleChange() {
if ( material[ `${ mapType }Scale` ] !== scale.getValue() ) {
editor.execute( new SetMaterialValueCommand( editor, object, `${ mapType }Scale`, scale.getValue(), 0 /* TODO: currentMaterialSlot */ ) );
}
}
function onScaleXYChange() {
const value = [ scaleX.getValue(), scaleY.getValue() ];
if ( material[ `${ mapType }Scale` ].x !== value[ 0 ] || material[ `${ mapType }Scale` ].y !== value[ 1 ] ) {
editor.execute( new SetMaterialVectorCommand( editor, object, `${ mapType }Scale`, value, 0 /* TODOL currentMaterialSlot */ ) );
}
}
function update() {
if ( object === null ) return;
if ( object.material === undefined ) return;
material = object.material;
if ( property in material ) {
if ( material[ property ] !== null ) {
map.setValue( material[ property ] );
}
enabled.setValue( material[ property ] !== null );
enabled.setDisabled( map.getValue() === null );
if ( intensity !== undefined ) {
intensity.setValue( material[ `${ property }Intensity` ] );
}
if ( scale !== undefined ) {
scale.setValue( material[ `${ mapType }Scale` ] );
}
if ( scaleX !== undefined ) {
scaleX.setValue( material[ `${ mapType }Scale` ].x );
scaleY.setValue( material[ `${ mapType }Scale` ].y );
}
container.setDisplay( '' );
} else {
container.setDisplay( 'none' );
}
}
//
signals.objectSelected.add( function ( selected ) {
object = selected;
map.setValue( null );
update();
} );
signals.materialChanged.add( update );
return container;
}
export { SidebarMaterialMapProperty };
import { UINumber, UIRow, UIText } from './libs/ui.js';
import { SetMaterialValueCommand } from './commands/SetMaterialValueCommand.js';
function SidebarMaterialNumberProperty( editor, property, name, range = [ - Infinity, Infinity ] ) {
const signals = editor.signals;
const container = new UIRow();
container.add( new UIText( name ).setWidth( '90px' ) );
const number = new UINumber().setWidth( '60px' ).setRange( range[ 0 ], range[ 1 ] ).onChange( onChange );
container.add( number );
let object = null;
let material = null;
function onChange() {
if ( material[ property ] !== number.getValue() ) {
editor.execute( new SetMaterialValueCommand( editor, object, property, number.getValue(), 0 /* TODO: currentMaterialSlot */ ) );
}
}
function update() {
if ( object === null ) return;
if ( object.material === undefined ) return;
material = object.material;
if ( property in material ) {
number.setValue( material[ property ] );
container.setDisplay( '' );
} else {
container.setDisplay( 'none' );
}
}
//
signals.objectSelected.add( function ( selected ) {
object = selected;
update();
} );
signals.materialChanged.add( update );
return container;
}
export { SidebarMaterialNumberProperty };
import { UIButton, UIRow, UIText } from './libs/ui.js';
function SidebarMaterialProgram( editor, property ) {
const signals = editor.signals;
const strings = editor.strings;
let object = null;
let material = null;
const container = new UIRow();
container.add( new UIText( strings.getKey( 'sidebar/material/program' ) ).setWidth( '90px' ) );
const programInfo = new UIButton( strings.getKey( 'sidebar/material/info' ) );
programInfo.setMarginRight( '4px' );
programInfo.onClick( function () {
signals.editScript.dispatch( object, 'programInfo' );
} );
container.add( programInfo );
const programVertex = new UIButton( strings.getKey( 'sidebar/material/vertex' ) );
programVertex.setMarginRight( '4px' );
programVertex.onClick( function () {
signals.editScript.dispatch( object, 'vertexShader' );
} );
container.add( programVertex );
const programFragment = new UIButton( strings.getKey( 'sidebar/material/fragment' ) );
programFragment.setMarginRight( '4px' );
programFragment.onClick( function () {
signals.editScript.dispatch( object, 'fragmentShader' );
} );
container.add( programFragment );
function update() {
if ( object === null ) return;
if ( object.material === undefined ) return;
material = object.material;
if ( property in material ) {
container.setDisplay( '' );
} else {
container.setDisplay( 'none' );
}
}
//
signals.objectSelected.add( function ( selected ) {
object = selected;
update();
} );
signals.materialChanged.add( update );
return container;
}
export { SidebarMaterialProgram };
此差异已折叠。
......@@ -402,7 +402,12 @@ function SidebarScene( editor ) {
if ( scene.environment ) {
// TODO
if ( scene.environment.mapping === THREE.EquirectangularReflectionMapping ) {
environmentType.setValue( 'Equirectangular' );
environmentEquirectangularTexture.setValue( scene.environment );
}
} else {
......@@ -434,6 +439,7 @@ function SidebarScene( editor ) {
}
refreshBackgroundUI();
refreshEnvironmentUI();
refreshFogUI();
}
......
......@@ -78,6 +78,7 @@ function Strings( config ) {
'menubar/help/source_code': 'Source Code',
'menubar/help/icons': 'Icon Pack',
'menubar/help/about': 'About',
'menubar/help/manual': 'Manual',
'sidebar/animations': 'Animations',
'sidebar/animations/play': 'Play',
......@@ -242,24 +243,26 @@ function Strings( config ) {
'sidebar/material/depthPacking': 'Depth Packing',
'sidebar/material/roughness': 'Roughness',
'sidebar/material/metalness': 'Metalness',
'sidebar/material/sheen': 'Sheen',
'sidebar/material/transmission': 'Transmission',
'sidebar/material/reflectivity': 'Reflectivity',
'sidebar/material/emissive': 'Emissive',
'sidebar/material/specular': 'Specular',
'sidebar/material/shininess': 'Shininess',
'sidebar/material/clearcoat': 'Clearcoat',
'sidebar/material/clearcoatroughness': 'Clearcoat Roughness',
'sidebar/material/transmission': 'Transmission',
'sidebar/material/attenuationDistance': 'Attenuation Distance',
'sidebar/material/attenuationTint': 'Attenuation Tint',
'sidebar/material/thickness': 'Thickness',
'sidebar/material/vertexcolors': 'Vertex Colors',
'sidebar/material/vertextangents': 'Vertex Tangents',
'sidebar/material/matcap': 'Matcap',
'sidebar/material/map': 'Map',
'sidebar/material/alphamap': 'Alpha Map',
'sidebar/material/bumpmap': 'Bump Map',
'sidebar/material/normalmap': 'Normal Map',
'sidebar/material/clearcoatnormalmap': 'Clearcoat Normal Map',
'sidebar/material/displacemap': 'Displace Map',
'sidebar/material/roughmap': 'Rough. Map',
'sidebar/material/metalmap': 'Metal. Map',
'sidebar/material/displacementmap': 'Displace Map',
'sidebar/material/roughnessmap': 'Rough. Map',
'sidebar/material/metalnessmap': 'Metal. Map',
'sidebar/material/specularmap': 'Specular Map',
'sidebar/material/envmap': 'Env Map',
'sidebar/material/lightmap': 'Light Map',
......@@ -267,19 +270,10 @@ function Strings( config ) {
'sidebar/material/emissivemap': 'Emissive Map',
'sidebar/material/gradientmap': 'Gradient Map',
'sidebar/material/side': 'Side',
'sidebar/material/side/front': 'Front',
'sidebar/material/side/back': 'Back',
'sidebar/material/side/double': 'Double',
'sidebar/material/size': 'Size',
'sidebar/material/sizeAttenuation': 'Size Attenuation',
'sidebar/material/flatshaded': 'Flat Shaded',
'sidebar/material/flatShading': 'Flat Shading',
'sidebar/material/blending': 'Blending',
'sidebar/material/blending/no': 'No',
'sidebar/material/blending/normal': 'Normal',
'sidebar/material/blending/additive': 'Additive',
'sidebar/material/blending/subtractive': 'Subtractive',
'sidebar/material/blending/multiply': 'Multiply',
'sidebar/material/blending/custom': 'Custom',
'sidebar/material/opacity': 'Opacity',
'sidebar/material/transparent': 'Transparent',
'sidebar/material/alphatest': 'Alpha Test',
......@@ -412,6 +406,7 @@ function Strings( config ) {
'menubar/help/source_code': 'Code Source',
'menubar/help/icons': 'Icon Pack',
'menubar/help/about': 'A propos',
'menubar/help/manual': 'Manual',
'sidebar/animations': 'Animations',
'sidebar/animations/play': 'Play',
......@@ -576,24 +571,26 @@ function Strings( config ) {
'sidebar/material/depthPacking': 'Encodage profondeur de couleur',
'sidebar/material/roughness': 'Rugosité',
'sidebar/material/metalness': 'Métal',
'sidebar/material/sheen': 'Éclat',
'sidebar/material/transmission': 'Transmission',
'sidebar/material/reflectivity': 'Reflectivity',
'sidebar/material/emissive': 'Émissif',
'sidebar/material/specular': 'Spéculaire',
'sidebar/material/shininess': 'Brillance',
'sidebar/material/clearcoat': 'Vernis',
'sidebar/material/clearcoatroughness': 'Rugosité du vernis',
'sidebar/material/transmission': 'Transmission',
'sidebar/material/attenuationDistance': 'Attenuation Distance',
'sidebar/material/attenuationTint': 'Attenuation Tint',
'sidebar/material/thickness': 'Thickness',
'sidebar/material/vertexcolors': 'Couleurs aux Sommets',
'sidebar/material/vertextangents': 'Tangentes aux sommets',
'sidebar/material/matcap': 'Matcap',
'sidebar/material/map': 'Texture',
'sidebar/material/alphamap': 'Texture de transparence',
'sidebar/material/bumpmap': 'Texture de relief',
'sidebar/material/normalmap': 'Texture de normales',
'sidebar/material/clearcoatnormalmap': 'Texture des normales du vernis',
'sidebar/material/displacemap': 'Texture de déplacement',
'sidebar/material/roughmap': 'Texture de rugosité',
'sidebar/material/metalmap': 'Texture métallique',
'sidebar/material/displacementmap': 'Texture de déplacement',
'sidebar/material/roughnessmap': 'Texture de rugosité',
'sidebar/material/metalnessmap': 'Texture métallique',
'sidebar/material/specularmap': 'Texture spéculaire',
'sidebar/material/envmap': 'Texture d\'environnement',
'sidebar/material/lightmap': 'Texture d\'éclairage',
......@@ -601,19 +598,10 @@ function Strings( config ) {
'sidebar/material/emissivemap': 'Texture d\'émission',
'sidebar/material/gradientmap': 'Texture de gradient',
'sidebar/material/side': 'Côté',
'sidebar/material/side/front': 'Face avant',
'sidebar/material/side/back': 'Face Arrière',
'sidebar/material/side/double': 'Double face',
'sidebar/material/size': 'Size',
'sidebar/material/sizeAttenuation': 'Size Attenuation',
'sidebar/material/flatshaded': 'Rendu plat',
'sidebar/material/flatShading': 'Flat Shading',
'sidebar/material/blending': 'Mélange',
'sidebar/material/blending/no': 'Non',
'sidebar/material/blending/normal': 'Normal',
'sidebar/material/blending/additive': 'Ajouter',
'sidebar/material/blending/subtractive': 'Soustraire',
'sidebar/material/blending/multiply': 'Multiplier',
'sidebar/material/blending/custom': 'Personnaliser',
'sidebar/material/opacity': 'Opacité',
'sidebar/material/transparent': 'Transparence',
'sidebar/material/alphatest': 'Test de transparence',
......@@ -746,6 +734,7 @@ function Strings( config ) {
'menubar/help/source_code': '源码',
'menubar/help/icons': '图标组件包',
'menubar/help/about': '关于',
'menubar/help/manual': 'Manual',
'sidebar/animations': '动画',
'sidebar/animations/play': '播放',
......@@ -910,24 +899,26 @@ function Strings( config ) {
'sidebar/material/depthPacking': '深度包装',
'sidebar/material/roughness': '粗糙度',
'sidebar/material/metalness': '金属度',
'sidebar/material/sheen': '光泽',
'sidebar/material/transmission': '透射',
'sidebar/material/reflectivity': 'Reflectivity',
'sidebar/material/emissive': '自发光',
'sidebar/material/specular': '高光',
'sidebar/material/shininess': '高光大小',
'sidebar/material/clearcoat': '清漆',
'sidebar/material/clearcoatroughness': '清漆粗糙度',
'sidebar/material/transmission': 'Transmission',
'sidebar/material/attenuationDistance': 'Attenuation Distance',
'sidebar/material/attenuationTint': 'Attenuation Tint',
'sidebar/material/thickness': 'Thickness',
'sidebar/material/vertexcolors': '顶点颜色',
'sidebar/material/vertextangents': '顶点切线',
'sidebar/material/matcap': '材质捕获',
'sidebar/material/map': '贴图',
'sidebar/material/alphamap': '透明贴图',
'sidebar/material/bumpmap': '凹凸贴图',
'sidebar/material/normalmap': '法线贴图',
'sidebar/material/clearcoatnormalmap': '清漆法线贴图',
'sidebar/material/displacemap': '置换贴图',
'sidebar/material/roughmap': '粗糙贴图',
'sidebar/material/metalmap': '金属贴图',
'sidebar/material/displacementmap': '置换贴图',
'sidebar/material/roughnessmap': '粗糙贴图',
'sidebar/material/metalnessmap': '金属贴图',
'sidebar/material/specularmap': '高光贴图',
'sidebar/material/envmap': '环境贴图',
'sidebar/material/lightmap': '光照贴图',
......@@ -935,19 +926,10 @@ function Strings( config ) {
'sidebar/material/emissivemap': '自发光贴图',
'sidebar/material/gradientmap': '渐变贴图',
'sidebar/material/side': '',
'sidebar/material/side/front': '正面',
'sidebar/material/side/back': '背面',
'sidebar/material/side/double': '双面',
'sidebar/material/size': '大小',
'sidebar/material/sizeAttenuation': '大小衰减',
'sidebar/material/flatshaded': '平面着色',
'sidebar/material/flatShading': 'Flat Shading',
'sidebar/material/blending': '混合',
'sidebar/material/blending/no': '',
'sidebar/material/blending/normal': '正常混合',
'sidebar/material/blending/additive': '和混合',
'sidebar/material/blending/subtractive': '差混合',
'sidebar/material/blending/multiply': '积混合',
'sidebar/material/blending/custom': '自定义混合',
'sidebar/material/opacity': '透明度',
'sidebar/material/transparent': '透明性',
'sidebar/material/alphatest': 'α测试',
......
......@@ -175,7 +175,8 @@ function Viewport( editor ) {
raycaster.setFromCamera( mouse, camera );
return raycaster.intersectObjects( objects );
return raycaster.intersectObjects( objects )
.filter( intersect => intersect.object.visible === true );
}
......@@ -596,7 +597,8 @@ function Viewport( editor ) {
if ( environmentEquirectangularTexture ) {
scene.environment = pmremGenerator.fromEquirectangular( environmentEquirectangularTexture ).texture;
environmentEquirectangularTexture.mapping = THREE.EquirectangularReflectionMapping;
scene.environment = environmentEquirectangularTexture;
}
......
......@@ -56,7 +56,7 @@ class UITexture extends UISpan {
// assuming RGBE/Radiance HDR iamge format
const loader = new RGBELoader().setDataType( THREE.UnsignedByteType );
const loader = new RGBELoader().setDataType( THREE.FloatType );
loader.load( event.target.result, function ( hdrTexture ) {
hdrTexture.sourceFile = file.name;
......
// r130.1
// r131
const cacheName = 'threejs-editor';
......@@ -175,6 +175,12 @@ const assets = [
'./js/Sidebar.Geometry.TubeGeometry.js',
'./js/Sidebar.Geometry.TeapotGeometry.js',
'./js/Sidebar.Material.js',
'./js/Sidebar.Material.BooleanProperty.js',
'./js/Sidebar.Material.ColorProperty.js',
'./js/Sidebar.Material.ConstantProperty.js',
'./js/Sidebar.Material.MapProperty.js',
'./js/Sidebar.Material.NumberProperty.js',
'./js/Sidebar.Material.Program.js',
'./js/Sidebar.Animation.js',
'./js/Sidebar.Script.js',
'./js/Strings.js',
......
......@@ -111,6 +111,12 @@
};
this.getDistance = function () {
return this.object.position.distanceTo( this.target );
};
this.listenToKeyEvents = function ( domElement ) {
domElement.addEventListener( 'keydown', onKeyDown );
......@@ -258,8 +264,8 @@
scope.domElement.removeEventListener( 'pointerdown', onPointerDown );
scope.domElement.removeEventListener( 'pointercancel', onPointerCancel );
scope.domElement.removeEventListener( 'wheel', onMouseWheel );
scope.domElement.ownerDocument.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.ownerDocument.removeEventListener( 'pointerup', onPointerUp );
scope.domElement.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.removeEventListener( 'pointerup', onPointerUp );
if ( scope._domElementKeyEvents !== null ) {
......@@ -704,8 +710,9 @@
if ( pointers.length === 0 ) {
scope.domElement.ownerDocument.addEventListener( 'pointermove', onPointerMove );
scope.domElement.ownerDocument.addEventListener( 'pointerup', onPointerUp );
scope.domElement.setPointerCapture( event.pointerId );
scope.domElement.addEventListener( 'pointermove', onPointerMove );
scope.domElement.addEventListener( 'pointerup', onPointerUp );
} //
......@@ -758,8 +765,9 @@
if ( pointers.length === 0 ) {
scope.domElement.ownerDocument.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.ownerDocument.removeEventListener( 'pointerup', onPointerUp );
scope.domElement.releasePointerCapture( event.pointerId );
scope.domElement.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.removeEventListener( 'pointerup', onPointerUp );
}
......
......@@ -389,8 +389,9 @@
if ( _pointers.length === 0 ) {
scope.domElement.ownerDocument.addEventListener( 'pointermove', onPointerMove );
scope.domElement.ownerDocument.addEventListener( 'pointerup', onPointerUp );
scope.domElement.setPointerCapture( event.pointerId );
scope.domElement.addEventListener( 'pointermove', onPointerMove );
scope.domElement.addEventListener( 'pointerup', onPointerUp );
} //
......@@ -444,8 +445,9 @@
if ( _pointers.length === 0 ) {
scope.domElement.ownerDocument.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.ownerDocument.removeEventListener( 'pointerup', onPointerUp );
scope.domElement.releasePointerCapture( event.pointerId );
scope.domElement.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.removeEventListener( 'pointerup', onPointerUp );
}
......@@ -537,8 +539,6 @@
}
scope.domElement.ownerDocument.addEventListener( 'pointermove', onPointerMove );
scope.domElement.ownerDocument.addEventListener( 'pointerup', onPointerUp );
scope.dispatchEvent( _startEvent );
}
......@@ -568,8 +568,6 @@
function onMouseUp() {
_state = STATE.NONE;
scope.domElement.ownerDocument.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.ownerDocument.removeEventListener( 'pointerup', onPointerUp );
scope.dispatchEvent( _endEvent );
}
......@@ -687,6 +685,15 @@
break;
case 2:
_state = STATE.TOUCH_ZOOM_PAN;
_moveCurr.copy( getMouseOnCircle( event.pageX - _movePrev.pageX, event.pageY - _movePrev.pageY ) );
_movePrev.copy( _moveCurr );
break;
}
scope.dispatchEvent( _endEvent );
......@@ -752,6 +759,8 @@
scope.domElement.removeEventListener( 'pointerdown', onPointerDown );
scope.domElement.removeEventListener( 'pointercancel', onPointerCancel );
scope.domElement.removeEventListener( 'wheel', onMouseWheel );
scope.domElement.removeEventListener( 'pointermove', onPointerMove );
scope.domElement.removeEventListener( 'pointerup', onPointerUp );
window.removeEventListener( 'keydown', keydown );
window.removeEventListener( 'keyup', keyup );
......
......@@ -243,8 +243,6 @@
if ( material.name === 'invisible' ) return;
const outlineParameters = originalMaterial.userData.outlineParameters;
material.morphTargets = originalMaterial.morphTargets;
material.morphNormals = originalMaterial.morphNormals;
material.fog = originalMaterial.fog;
material.toneMapped = originalMaterial.toneMapped;
material.premultipliedAlpha = originalMaterial.premultipliedAlpha;
......
......@@ -396,7 +396,7 @@ ${array.join( '' )}
}
if ( material.roughnessMap !== null ) {
if ( material.roughnessMap !== null && material.roughness === 1 ) {
inputs.push( `${pad}float inputs:roughness.connect = </Materials/Material_${material.id}/Texture_${material.roughnessMap.id}_roughness.outputs:g>` );
samplers.push( buildTexture( material.roughnessMap, 'roughness' ) );
......@@ -407,7 +407,7 @@ ${array.join( '' )}
}
if ( material.metalnessMap !== null ) {
if ( material.metalnessMap !== null && material.metalness === 1 ) {
inputs.push( `${pad}float inputs:metallic.connect = </Materials/Material_${material.id}/Texture_${material.metalnessMap.id}_metallic.outputs:b>` );
samplers.push( buildTexture( material.metalnessMap, 'metallic' ) );
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -6,7 +6,7 @@
super( manager );
this.hdrLoader = new THREE.RGBELoader();
this.type = THREE.UnsignedByteType;
this.type = THREE.FloatType;
}
......
此差异已折叠。
......@@ -176,7 +176,6 @@
spec.size = 0.1;
spec.map = mat.map;
spec.morphTargets = mat.morphTargets;
materials[ i ] = new THREE.PointsMaterial( spec );
} else if ( type === 'lines' ) {
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册