小编Jay*_*tti的帖子

Three.js旋转纹理

我有一个纹理应用于网格我可以改变偏移量

mesh.material.map.offset.set
Run Code Online (Sandbox Code Playgroud)

我可以改变缩放比例

mesh.material.repeat.set
Run Code Online (Sandbox Code Playgroud)

所以我的问题是,如何在平面内旋转纹理?

例:

由此:

在此输入图像描述

对此

在此输入图像描述

谢谢.

three.js

8
推荐指数
1
解决办法
9654
查看次数

三个JS Map Material导致WebGL警告

我正在尝试通过以下包装函数定义从OBJLoader加载的网格物料:

function applyTexture(src){
    var texture = new THREE.Texture();
    var loader = new THREE.ImageLoader();
    loader.addEventListener( 'load', function ( event ) {
        texture.image = event.content;
        texture.needsUpdate = true;

        // find the meshes from the loaded OBJ and apply the texture to it.
        object.traverse( function ( child ) {
            if ( child instanceof THREE.Mesh ) {
                if(child.name.indexOf("Lens") < 0){
                    child.dynamic = true;

                   child.material = new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.FlatShading, map : texture } );
                   // also tried:
                   //child.material = new THREE.MeshPhongMaterial( …
Run Code Online (Sandbox Code Playgroud)

texture-mapping three.js

6
推荐指数
1
解决办法
3926
查看次数

标签 统计

three.js ×2

texture-mapping ×1