THREE.ImageUtils 怎么了? [英] What happened to THREE.ImageUtils?

查看:48
本文介绍了THREE.ImageUtils 怎么了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正在更新一些关于纹理的旧 javascript Three.js 代码.特别是下面的第二行.

Working on updating some old javascript three.js code on textures. Specifically the second line below.

var groundColor = new THREE.Color(0xd2ddef);
var groundTexture = new THREE.ImageUtils().generateDataTexture(1, 1, groundColor); // this line
var groundMaterial = new THREE.MeshPhongMaterial({ color: 0xffffff, specular: 0x111111, map: groundTexture });

var groundTexture = new THREE.TextureLoader().load('img/ground.jpg', undefined, function() { groundMaterial.map = groundTexture });
groundTexture.wrapS = groundTexture.wrapT = THREE.RepeatWrapping;
groundTexture.repeat.set(25, 25);
groundTexture.anisotropy = 16;

three.js 取代了 THREE.ImageUtils().generateDataTexture 的新方法/构造函数/等是什么?

What new method/constructor/etc has three.js replaced THREE.ImageUtils().generateDataTexture?

推荐答案

generateDataTexture 已从 r73 中的three.js 核心中删除.但是这里是它被删除的提交,您可以在其中找到简单的generateDataTexture 函数.您可以将它复制并粘贴到您的代码中,并根据需要调用它.[r88]

generateDataTexture was removed from three.js core in r73. However here is the commit where it was removed where you can find the simple generateDataTexture function. You could just copy and paste it into your code and call it as needed. [r88]

这篇关于THREE.ImageUtils 怎么了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆