Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Improve VideoTexture page. #24768

Merged
merged 1 commit into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions docs/api/en/textures/VideoTexture.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
<h1>[name]</h1>

<p class="desc">
Creates a texture for use with a video texture.<br /><br />
Creates a texture for use with a video.
</p>

This is almost the same as the base [page:Texture Texture] class, except that it continuously sets [page:Texture.needsUpdate needsUpdate] to `true` so that the texture is updated as the video plays. Automatic creation of [page:Texture.mipmaps mipmaps] is also disabled.
<p>
Note: After the initial use of a texture, the video cannot be changed. Instead, call [page:.dispose]() on the texture and instantiate a new one.
</p>

<h2>Code Example</h2>
Expand All @@ -27,7 +29,13 @@ <h2>Code Example</h2>

<h2>Examples</h2>

<p>[example:webgl_materials_video materials / video ]</p>
<p>
[example:webgl_materials_video materials / video]<br />
[example:webgl_materials_video_webcam materials / video / webcam]<br />
[example:webgl_video_kinect video / kinect]<br />
[example:webgl_video_panorama_equirectangular video / panorama / equirectangular]<br />
[example:webxr_vr_video vr / video]
</p>

<h2>Constructor</h2>
<h3>[name]( [param:Video video], [param:Constant mapping], [param:Constant wrapS], [param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter], [param:Constant format], [param:Constant type], [param:Number anisotropy] )</h3>
Expand All @@ -47,7 +55,7 @@ <h3>[name]( [param:Video video], [param:Constant mapping], [param:Constant wrapS
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 />
The default is [page:Textures THREE.LinearFilter]. See [page:Textures minification filter constants] for other choices.<br />

[page:Constant format] -- The default is [page:Textures THREE.RGBAFormat].
See [page:Textures format constants] for other choices.<br />
Expand All @@ -69,7 +77,7 @@ <h2>Properties</h2>

<h3>[property:Boolean generateMipmaps]</h3>
<p>
Whether to generate mipmaps. False by default.
Whether to generate mipmaps. `false` by default.
</p>

<h3>[property:Boolean isVideoTexture]</h3>
Expand All @@ -79,7 +87,7 @@ <h3>[property:Boolean isVideoTexture]</h3>

<h3>[property:Boolean needsUpdate]</h3>
<p>
You will not need to set this manually here as it is handled by the [page:VideoTexture.update update] method.
You will not need to set this manually here as it is handled by the [page:VideoTexture.update update]() method.
</p>

<h2>Methods</h2>
Expand Down
20 changes: 14 additions & 6 deletions docs/api/zh/textures/VideoTexture.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
<h1>视频纹理([name])</h1>

<p class="desc">
创建一个使用视频来作为贴图的纹理对象。<br /><br />
创建一个使用视频来作为贴图的纹理对象。
</p>

它和其基类[page:Texture Texture]几乎是相同的,除了它总是将[page:Texture.needsUpdate needsUpdate]设置为*true*,以便使得贴图能够在视频播放时进行更新。自动创建[page:Texture.mipmaps mipmaps]也会被禁用。
<p>
Note: After the initial use of a texture, the video cannot be changed. Instead, call [page:.dispose]() on the texture and instantiate a new one.
</p>

<h2>代码示例</h2>
Expand All @@ -27,7 +29,13 @@ <h2>代码示例</h2>

<h2>例子</h2>

<p>[example:webgl_materials_video materials / video ]</p>
<p>
[example:webgl_materials_video materials / video]<br />
[example:webgl_materials_video_webcam materials / video / webcam]<br />
[example:webgl_video_kinect video / kinect]<br />
[example:webgl_video_panorama_equirectangular video / panorama / equirectangular]<br />
[example:webxr_vr_video vr / video]
</p>

<h2>构造函数</h2>
<h3>[name]( [param:Video video], [param:Constant mapping], [param:Constant wrapS], [param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter], [param:Constant format], [param:Constant type], [param:Number anisotropy] )</h3>
Expand All @@ -47,7 +55,7 @@ <h3>[name]( [param:Video video], [param:Constant mapping], [param:Constant wrapS
其默认值为[page:Textures THREE.LinearFilter]。请参阅[page:Textures magnification filter constants](放大滤镜常量)来了解其它选项。<br />

[page:Constant minFilter] -- 当一个纹素覆盖小于一个像素时,贴图将如何采样。
其默认值为[page:Textures THREE.LinearMipmapLinearFilter]。请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其它选项。<br />
其默认值为[page:Textures THREE.LinearFilter]。请参阅[page:Textures minification filter constants](缩小滤镜常量)来了解其它选项。<br />

[page:Constant format] -- The default is [page:Textures THREE.RGBAFormat].
请参阅[page:Textures format constants](格式常量)来了解各个选项。<br />
Expand All @@ -69,7 +77,7 @@ <h2>属性</h2>

<h3>[property:Boolean generateMipmaps]</h3>
<p>
Whether to generate mipmaps. False by default.
Whether to generate mipmaps. `false` by default.
</p>

<h3>[property:Boolean isVideoTexture]</h3>
Expand All @@ -79,7 +87,7 @@ <h3>[property:Boolean isVideoTexture]</h3>

<h3>[property:Boolean needsUpdate]</h3>
<p>
在这里,你不必手动设置这个值,因为它是由[page:VideoTexture.update update]方法来进行控制的。
在这里,你不必手动设置这个值,因为它是由[page:VideoTexture.update update]()方法来进行控制的。
</p>

<h2>方法</h2>
Expand Down