Przeglądaj źródła

doc(shaders, scenes, webgl):中文文档

hucijiao 6 lat temu
rodzic
commit
bf10f07188

+ 1 - 1
docs/api/zh/renderers/WebGLRenderer.html

@@ -122,7 +122,7 @@
 		<h3>[property:DOMElement domElement]</h3>
 		<p>
 		一个[link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas],渲染器在其上绘制输出。<br />
-		渲染器的构造函数会自动创建(如果没有传入canvas参数);你需要做的仅仅是像下面这样将它加页面里去<br />
+		渲染器的构造函数会自动创建(如果没有传入canvas参数);你需要做的仅仅是像下面这样将它加页面里去:<br />
 		<code>
 			document.body.appendChild( renderer.domElement );
 		</code>

+ 4 - 4
docs/api/zh/renderers/shaders/ShaderChunk.html

@@ -10,19 +10,19 @@
 	<body>
 		<h1>[name]</h1>
 
-		<p class="desc">Shader chunks for WebGL Shader library</p>
+		<p class="desc">WebGL着色器库的着色器片段</p>
 
 
 
-		<h2>Properties</h2>
+		<h2>属性</h2>
 
 
 
-		<h2>Methods</h2>
+		<h2>方法</h2>
 
 
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>

+ 4 - 4
docs/api/zh/renderers/shaders/ShaderLib.html

@@ -10,18 +10,18 @@
 	<body>
 		<h1>[name]</h1>
 
-		<p class="desc">Webgl Shader Library for three.js</p>
+		<p class="desc">three.js的WebGL着色器库</p>
 
 
-		<h2>Properties</h2>
+		<h2>属性</h2>
 
 
 
-		<h2>Methods</h2>
+		<h2>方法</h2>
 
 
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>

+ 4 - 4
docs/api/zh/renderers/shaders/UniformsLib.html

@@ -10,19 +10,19 @@
 	<body>
 		<h1>[name]</h1>
 
-		<p class="desc">Uniforms library for shared webgl shaders</p>
+		<p class="desc">为webgl着色器提供的Uniforms库</p>
 
 
 
-		<h2>Properties</h2>
+		<h2>属性</h2>
 
 
 
-		<h2>Methods</h2>
+		<h2>方法</h2>
 
 
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>

+ 4 - 4
docs/api/zh/renderers/shaders/UniformsUtils.html

@@ -10,17 +10,17 @@
 	<body>
 		<h1>[name]</h1>
 
-		<p class="desc">Uniform Utilities. Support merging and cloning of uniform variables</p>
+		<p class="desc">Uniform工具. 支持uniform变量的合并和克隆</p>
 
-		<h2>Properties</h2>
+		<h2>属性</h2>
 
 
 
-		<h2>Methods</h2>
+		<h2>方法</h2>
 
 
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>

+ 14 - 14
docs/api/zh/renderers/webgl/WebGLProgram.html

@@ -10,11 +10,11 @@
 	<body>
 		<h1>[name]</h1>
 
-		<p class="desc">Constructor for the GLSL program sent to vertex and fragment shaders, including default uniforms and attributes.</p>
+		<p class="desc">发送到顶点着色器和片元着色器的GLSL程序的构造函数, 包含默认的变量(uniforms)和属性</p>
 
-		<h2>Built-in uniforms and attributes</h2>
+		<h2>内置的变量(uniforms)和属性</h2>
 
-		<h3>Vertex shader (unconditional):</h3>
+		<h3>顶点着色器(无条件的):</h3>
 		<div>
 		<code>
 		// = object.matrixWorld
@@ -42,18 +42,18 @@
 		attribute vec2 uv;
 		</code>
 		<p>
-		Note that you can therefore calculate the position of a vertex in the vertex shader by:
+        注意,可以通过以下方式计算顶点着色器中顶点的位置:
 		<code>
 		gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
 		</code>
-		or alternatively
+		或者也可以这样:
 		<code>
 		gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4( position, 1.0 );
 		</code>
 		</p>
 		</div>
 
-		<h3>Vertex shader (conditional):</h3>
+		<h3>顶点着色器(有条件的):</h3>
 		<div>
 		<code>
 		#ifdef USE_COLOR
@@ -94,7 +94,7 @@
 		</code>
 		</div>
 
-		<h3>Fragment shader:</h3>
+		<h3>片元着色器:</h3>
 		<div>
 		<code>
 		uniform mat4 viewMatrix;
@@ -103,12 +103,12 @@
 		</div>
 
 
-		<h2>Constructor</h2>
+		<h2>构造器</h2>
 
 		<h3>[name]( [param:WebGLRenderer renderer], [param:Object code], [param:Material material], [param:Object parameters] )</h3>
-		<p>For parameters see [page:WebGLRenderer WebGLRenderer]</p>
+		<p>参数详见[page:WebGLRenderer WebGLRenderer]</p>
 
-		<h2>Properties</h2>
+		<h2>属性</h2>
 
 		<h3>[property:String id]</h3>
 		<p></p>
@@ -128,19 +128,19 @@
 		<h3>[property:WebGLShader fragmentShader]</h3>
 		<p></p>
 
-		<h2>Methods</h2>
+		<h2>方法</h2>
 
 		<h3>[method:Object getUniforms]()</h3>
 		<p>
-		Returns a name-value mapping of all active uniform locations.
+        返回所有活动态的变量(uniform)位置的name-value映射
 		</p>
 
 		<h3>[method:Object getAttributes]()</h3>
 		<p>
-		Returns a name-value mapping of all active vertex attribute locations.
+        返回所有活动态的顶点属性位置的name-value映射
 		</p>
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>

+ 10 - 9
docs/api/zh/renderers/webgl/WebGLShader.html

@@ -10,9 +10,9 @@
 	<body>
 		<h1>[name]</h1>
 
-		<p class="desc">A lower level function to compile either a vertex or fragment shader.</p>
+		<p class="desc">编译顶点或片元着色器的更底层的函数</p>
 
-		<h2>Example</h2>
+		<h2>示例</h2>
 
 		<code>
 		var gl = renderer.context;
@@ -28,21 +28,22 @@
 		gl.linkProgram( program );
 		</code>
 
-		<h2>Function</h2>
+		<h2>函数</h2>
 
 		<h3>[page:WebGLShader objects]([page:WebGLContext gl], [page:WebGLEnum type], [page:String source])</h3>
 
 		<p>
-		gl -- The current WebGL context
-		type -- The WebGL type, either gl.VERTEX_SHADER or gl.FRAGMENT_SHADER
-		source -- The source code for the shader
+		gl -- 当前的WebGL环境
+		type -- WebGL类型,值是gl.VERTEX_SHADER 或者 gl.FRAGMENT_SHADER
+		source -- 着色器源码
 		</p>
 		<p>
-		This will compile an individual shader, but won't link it to be a complete [page:WebGLProgram]. Note: this
-		is a function so the new operator should not be used.
+        此函数将编译一个独立的着色器,不会将它和一个完整的[page:WebGLProgram]链接起来。
+		说明: 这是一个函数,因此不应该使用新的操作符。
+
 		</p>
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>

+ 13 - 13
docs/api/zh/renderers/webgl/WebGLState.html

@@ -13,47 +13,47 @@
 		<p class="desc"></p>
 
 
-		<h2>Methods</h2>
+		<h2>方法</h2>
 
 		<h3>[method:null enable]( [param:integer id], [param:boolean boolean] )</h3>
 		<p>
-		TODO
+		未完成
 		</p>
 
 		<h3>[method:null disable]( [param:integer id], [param:boolean boolean] )</h3>
 		<p>
-		TODO
+		未完成
 		</p>
 
 		<h3>[method:null setDepthTest]( [param:boolean depthTest] )</h3>
 		<p>
-		depthTest -- The boolean to decide if depth of a fragment needs to be tested against the depth buffer . <br />
+		depthTest -- 决定是否需要基于深度缓存对片元进行深度测试的布尔值<br />
 		</p>
 		<p>
-		This sets, based on depthTest, whether or not the depth data needs to be tested against the depth buffer.
+		该方法设置了depthTest的值,故可决定是否需要基于深度缓存测试深度数据
 		</p>
 
 		<h3>[method:null setDepthWrite]( [param:boolean depthWrite] )</h3>
 		<p>
-		depthWrite -- The boolean to decide if depth of a fragment needs to be kept. <br />
+		depthWrite -- 决定是否需要保持片元深度的布尔值<br />
 		</p>
 		<p>
-		This sets, based on depthWrite, whether or not the depth data needs to be written in the depth buffer.
+		该方法设置depthWrite的值,故可决定是否要将深度数据写入深度缓存中
 		</p>
 
 		<h3>[method:null setBlending]( [param:number blending], [param:number blendEquation], [param:number blendSrc], [param:number blendDst] )</h3>
 		<p>
-		blending -- A number indicating the blending mode. Possible value are THREE.NoBlending, THREE.NormalBlending, THREE.AdditiveBlending, THREE.SubtractiveBlending, THREE.MultiplyBlending or THREE.CustomBlending <br />
-		blendEquation -- When blending is THREE.CustomBlending, then you can set the blendEquation. Possible values are THREE.AddEquation, THREE.SubtractEquation or THREE.ReverseSubtractEquation.<br />
-		blendSrc -- When blending is THREE.CustomBlending, then you can set the blendSrc. Possible values are THREE.ZeroFactor, THREE.OneFactor,THREE.SrcColorFactor, THREE.OneMinusSrcColorFactor, THREE.SrcAlphaFactor, THREE.OneMinusSrcAlphaFactor, THREE.DstAlphaFactor, THREE.OneMinusDstAlphaFactor, THREE.DstColorFactor,THREE.OneMinusDstColorFactor or THREE.SrcAlphaSaturateFactor<br />
-		blendDst -- When blending is THREE.CustomBlending, then you can set the blendDst. Possible values are THREE.ZeroFactor, THREE.OneFactor,THREE.SrcColorFactor, THREE.OneMinusSrcColorFactor, THREE.SrcAlphaFactor, THREE.OneMinusSrcAlphaFactor, THREE.DstAlphaFactor, THREE.OneMinusDstAlphaFactor, THREE.DstColorFactor,THREE.OneMinusDstColorFactor or THREE.SrcAlphaSaturateFactor
+		blending -- 一个表示混合模式的数字。可能的值有THREE.NoBlending, THREE.NormalBlending, THREE.AdditiveBlending, THREE.SubtractiveBlending, THREE.MultiplyBlending  THREE.CustomBlending <br />
+		blendEquation -- 如果blending的值是THREE.CustomBlending,那么你可以设置blendEquation. 可能的值有THREE.AddEquation, THREE.SubtractEquation 和 THREE.ReverseSubtractEquation.<br />
+		blendSrc -- 如果blending的值是THREE.CustomBlending, 那么你可以设置blendSrc.可能的值有THREE.ZeroFactor, THREE.OneFactor,THREE.SrcColorFactor, THREE.OneMinusSrcColorFactor, THREE.SrcAlphaFactor, THREE.OneMinusSrcAlphaFactor, THREE.DstAlphaFactor, THREE.OneMinusDstAlphaFactor, THREE.DstColorFactor,THREE.OneMinusDstColorFactor  THREE.SrcAlphaSaturateFactor<br />
+		blendDst -- 如果blending的值是THREE.CustomBlending, 那么你可以设置blendDst. 可能的值有THREE.ZeroFactor, THREE.OneFactor,THREE.SrcColorFactor, THREE.OneMinusSrcColorFactor, THREE.SrcAlphaFactor, THREE.OneMinusSrcAlphaFactor, THREE.DstAlphaFactor, THREE.OneMinusDstAlphaFactor, THREE.DstColorFactor,THREE.OneMinusDstColorFactor or THREE.SrcAlphaSaturateFactor
 		</p>
 		<p>
-		This method sets the correct blending.
+		该方法设置正确的混合
 		</p>
 
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>

+ 14 - 14
docs/api/zh/scenes/Fog.html

@@ -10,40 +10,40 @@
 	<body>
 		<h1>[name]</h1>
 
-		<p class="desc">This class contains the parameters that define linear fog, i.e., that grows linearly denser with the distance.</p>
+		<p class="desc">此类包含定义线性雾化的参数,即雾的浓度会随着距离线性增长</p>
 
 
-		<h2>Constructor</h2>
+		<h2>构造器</h2>
 
 
 		<h3>[name]( [param:Integer color], [param:Float near], [param:Float far] )</h3>
-		<p>The color parameter is passed to the [page:Color] constructor to set the color property. Color can be a hexadecimal integer or a CSS-style string.</p>
+		<p>颜色参数会传入[page:Color]构造器以设置颜色属性. 颜色可以是十六进制的或者CSS风格的字符串</p>
 
-		<h2>Properties</h2>
+		<h2>属性</h2>
 
 		<h3>[property:String name]</h3>
-		<p>Optional name of the object (doesn't need to be unique). Default is an empty string.</p>
+		<p>对象的可选名称(不需要唯一)。 默认是一个空串</p>
 
 		<h3>[property:Color color]</h3>
-		<p>Fog color.  Example: If set to black, far away objects will be rendered black.</p>
+		<p>雾的颜色。  例如:如果是黑色, 远处的对象将会被渲染为黑色</p>
 
 		<h3>[property:Float near]</h3>
-		<p>The minimum distance to start applying fog. Objects that are less than 'near' units from the active camera won't be affected by fog.</p>
-		<p>Default is 1.</p>
+		<p>雾化开始运用的最小距离。到相机的距离小于'near'个单位的对象将不受雾化影响</p>
+		<p>默认是1</p>
 
 		<h3>[property:Float far]</h3>
-		<p>The maximum distance at which fog stops being calculated and applied. Objects that are more than 'far' units away from the active camera won't be affected by fog.</p>
-		<p>Default is 1000.</p>
+		<p>停止计算和应用雾化的最大距离。到相机的距离大于'far'个单位的对象将不受雾化影响</p>
+		<p>默认是1000</p>
 
-		<h2>Methods</h2>
+		<h2>方法</h2>
 
 		<h3>[method:Fog clone]()</h3>
-		<p>Returns a new fog instance with the same parameters as this one.</p>
+		<p>返回一个新的雾化实例,它有着和传入雾化实例一样的参数</p>
 
 		<h3>[method:Fog toJSON]()</h3>
-		<p>Return fog data in JSON format.</p>
+		<p>返回JSON格式的雾化</p>
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>

+ 12 - 12
docs/api/zh/scenes/FogExp2.html

@@ -10,36 +10,36 @@
 	<body>
 		<h1>[name]</h1>
 
-		<p class="desc">This class contains the parameters that define exponential fog, i.e., that grows exponentially denser with the distance.</p>
+		<p class="desc">此类包含定义指数雾化的参数,即雾的浓度会随着距离指数增长</p>
 
 
-		<h2>Constructor</h2>
+		<h2>构造器</h2>
 
 
 		<h3>[name]( [param:Integer color], [param:Float density] )</h3>
 
-		<p>The color parameter is passed to the [page:Color] constructor to set the color property. Color can be a hexadecimal integer or a CSS-style string.</p>
-		<h2>Properties</h2>
+		<p>颜色参数会传入[page:Color]构造器以设置颜色属性. 颜色可以是十六进制的或者CSS风格的字符串</p>
+		<h2>属性</h2>
 
 		<h3>[property:String name]</h3>
-		<p>Optional name of the object (doesn't need to be unique). Default is an empty string.</p>
+		<p>对象的可选名称(不需要唯一)。 默认是一个空串</p>
 
 		<h3>[property:Color color]</h3>
-		<p>Fog color. Example: If set to black, far away objects will be rendered black.</p>
+		<p>雾的颜色。例如:如果是黑色, 远处的对象将会被渲染为黑色</p>
 
 		<h3>[property:Float density]</h3>
-		<p>Defines how fast the fog will grow dense.</p>
-		<p>Default is 0.00025.</p>
+		<p>定义雾的浓度增长多快</p>
+		<p>默认是0.00025.</p>
 
-		<h2>Methods</h2>
+		<h2>方法</h2>
 
 		<h3>[method:FogExp2 clone]()</h3>
-		<p>Returns a new FogExp2 instance with the same parameters as this one.</p>
+		<p>返回一个新的FogExp2实例,他拥有和传入实例一样的参数</p>
 
 		<h3>[method:FogExp2 toJSON]()</h3>
-		<p>Return FogExp2 data in JSON format.</p>
+		<p>返回JSON格式的指数雾化数据</p>
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>

+ 12 - 12
docs/api/zh/scenes/Scene.html

@@ -11,47 +11,47 @@
 		[page:Object3D] &rarr;
 		<h1>[name]</h1>
 
-		<p class="desc">Scenes allow you to set up what and where is to be rendered by three.js. This is where you place objects, lights and cameras.</p>
+		<p class="desc">场景允许你设置threejs在哪里渲染什么内容。场景就是你放置对象、灯光和相机的地方</p>
 
 
-		<h2>Constructor</h2>
+		<h2>构造器</h2>
 
 
 		<h3>[name]()</h3>
 		<p>
-		Create a new scene object.
+		创建一个新的场景对象
 		</p>
 
 
-		<h2>Properties</h2>
+		<h2>属性</h2>
 
 		<h3>[property:Fog fog]</h3>
 
-		<p>A [page:Fog fog] instance defining the type of fog that affects everything rendered in the scene. Default is null.</p>
+		<p>一个[page:Fog fog]的实例,定义了一种影响场景中渲染出来的所有东西的雾。默认值是null.</p>
 
 		<h3>[property:Material overrideMaterial]</h3>
 
-		<p>If not null, it will force everything in the scene to be rendered with that material. Default is null.</p>
+		<p>如果不为null, 它会强制场景中的所有东西都用改材质渲染。 默认值是null</p>
 
 		<h3>[property:boolean autoUpdate]</h3>
 		<p>
-		Default is true. If set, then the renderer checks every frame if the scene and its objects needs matrix updates.
-		When it isn't, then you have to maintain all matrices in the scene yourself.
+		默认是true。如果设置,那么渲染器会检查检查每一帧确定场景及其中的对象是否需要矩阵更新。
+		否则,你必须自己维护场景中的所有矩阵。
 		</p>
 
 		<h3>[property:Object background]</h3>
 		<p>
-		If not null, sets the background used when rendering the scene, and is always rendered first. Can be set to a [page:Color] which sets the clear color, a [page:Texture] covering the canvas, or a [page:CubeTexture]. Default is null.
+		如果不为null, 在渲染场景时设置下所用背景,它将总是最先被渲染. 可以被设置为[page:Color](它设置了清除颜色), 一个覆盖了canvas的 [page:Texture], 或者一个[page:CubeTexture]。默认是null
 		</p>
 
-		<h2>Methods</h2>
+		<h2>方法</h2>
 
 		<h3>[method:JSON toJSON]</h3>
 		<p>
-		Return the scene data in JSON format.
+        返回JSON格式的场景数据
 		</p>
 
-		<h2>Source</h2>
+		<h2>源码</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
 	</body>