【问题标题】:Threejs: repeating texture inside of load for a single canvas renderThreejs:在单个画布渲染的负载内重复纹理
【发布时间】:2018-12-03 09:06:04
【问题描述】:

我正在使用 threejs 库渲染一个球体,用于响应“import * as THREE from 'three';”。

球体渲染良好,纹理也如此。

我有一个加载得很好的图像,它包裹了整个球体。

问题:如何在球体上重复图像?在我的具体示例中,假设我有一张半张脸的图像。每个半球,我想镜像那个图像,这样我就会在球体的每一侧有两个对称的面,向外看。全新的threejs,任何帮助表示赞赏!

【问题讨论】:

    标签: three.js


    【解决方案1】:

    可能在Texture 上设置重复。
    例如。

    // load a texture, set wrap mode to repeat
    var texture = new THREE.TextureLoader().load( "textures/water.jpg" );
    texture.wrapS = THREE.RepeatWrapping;
    texture.wrapT = THREE.RepeatWrapping;
    texture.repeat.set( 4, 4 );
    

    【讨论】:

      猜你喜欢
      • 2013-08-21
      • 1970-01-01
      • 2014-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-01
      • 1970-01-01
      • 2016-12-24
      相关资源
      最近更新 更多