Kaynağa Gözat

created documentation for VideoTexture (#10016)

Lewy Blue 8 yıl önce
ebeveyn
işleme
ae6b6f6ab2
2 değiştirilmiş dosya ile 102 ekleme ve 1 silme
  1. 100 0
      docs/api/textures/VideoTexture.html
  2. 2 1
      docs/list.js

+ 100 - 0
docs/api/textures/VideoTexture.html

@@ -0,0 +1,100 @@
+<!DOCTYPE html>
+<html lang="en">
+	<head>
+		<meta charset="utf-8" />
+		<base href="../../" />
+		<script src="list.js"></script>
+		<script src="page.js"></script>
+		<link type="text/css" rel="stylesheet" href="page.css" />
+	</head>
+	<body>
+		[page:Texture] &rarr;
+
+		<h1>[name]</h1>
+
+		<div class="desc">
+		Creates a texture for use with a video texture.<br /><br />
+
+		This is almost the same as the base [page:Texture Texture] class,
+    except that it continuosly sets [page:Texture.needsUpdate needsUpdate] to *true*
+    (using <a href="https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame">requestAnimationFrame</a>)
+    so that the texture is updated as the video plays. Automatic creation of [page:Texture.mipmaps mipmaps]
+    is also disabled.
+		</div>
+
+    <h2>Example</h2>
+
+		<div>[example:webgl_materials_video materials / video ]</div>
+
+		<code>
+//assuming you have created a HTML video element with id="video"
+var video = document.getElementById( 'video' );
+
+var texture = new THREE.VideoTexture( video );
+texture.minFilter = THREE.LinearFilter;
+texture.magFilter = THREE.LinearFilter;
+texture.format = THREE.RGBFormat;
+    </code>
+
+
+		<h2>Constructor</h2>
+		<h3>[name]( [page:Video video], [page:Constant mapping], [page:Constant wrapS], [page:Constant wrapT], [page:Constant magFilter], [page:Constant minFilter], [page:Constant format], [page:Constant type], [page:Number anisotropy] )</h3>
+		<div>
+		[page:Video video] -- The video element to use as the texture. <br />
+
+		[page:Constant mapping] --  How the image is applied to the object. An object type of [page:Textures THREE.UVMapping].
+		See [page:Textures mapping constants] for other choices.<br />
+
+		[page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
+		See [page:Textures wrap mode constants] for other choices.<br />
+
+		[page:Constant magFilter] -- How the texture is sampled when a texel covers more than one pixel.
+		The default is [page:Textures THREE.LinearFilter]. See [page:Textures magnification filter constants] for other choices.<br />
+
+		[page:Constant minFilter] -- How the texture is sampled when a texel covers less than one pixel.
+		 The default is [page:Textures THREE.LinearMipMapLinearFilter]. See [page:Textures minification filter constants] for other choices.<br />
+
+    [page:Constant format] -- The format used in the texture.
+     See [page:Textures format constants] for other choices.<br />
+
+    [page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
+     See [page:Textures type constants] for other choices.<br />
+
+		[page:Number anisotropy] -- The number of samples taken along the axis through the pixel that has the highest density of texels.
+		By default, this value is 1. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used.
+		Use [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.<br /><br />
+		</div>
+
+
+		<h2>Properties</h2>
+
+		<div>
+    See the base [page:Texture Texture] class for common properties.
+    </div>
+
+		<h3>[property:boolean needsUpdate]</h3>
+		<div>
+		You will not need to set this manually here as it is handled by the [page:VideoTexture.update update] method.
+		</div>
+
+		<h2>Methods</h2>
+
+    <div>
+    See the base [page:Texture Texture] class for common methods.
+    </div>
+
+    <h3>[method:null update]()</h3>
+		<div>
+		This is called automatically and sets [property:boolean needsUpdate] to *true* every time
+    a new frame is available.
+		</div>
+
+
+		<h2>Source</h2>
+
+		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+	</body>
+</html>

+ 2 - 1
docs/list.js

@@ -201,7 +201,8 @@ var list = {
 			[ "CompressedTexture", "api/textures/CompressedTexture" ],
 			[ "CubeTexture", "api/textures/CubeTexture" ],
 			[ "DataTexture", "api/textures/DataTexture" ],
-			[ "Texture", "api/textures/Texture" ]
+			[ "Texture", "api/textures/Texture" ],
+			[ "VideoTexture", "api/textures/VideoTexture" ]
 		],
 
 		"Animation": [