【发布时间】:2020-12-04 03:39:35
【问题描述】:
我目前正在尝试创建一个使用数据纹理着色的网格,我的初始着色显示得很好,但现在我的下一个目标是沿 y 轴偏移纹理。和这个例子很相似。
http://math.hws.edu/graphicsbook/demos/c5/textures.html
我如何创建纹理/网格:
this.colorTexture = new DataTexture(colors, this.frameWidth, frameCount, RGBFormat, FloatType, UVMapping, RepeatWrapping, RepeatWrapping);
const material = new MeshBasicMaterial({
side: FrontSide,
vertexColors: true,
wireframe: false,
map: this.colorTexture
});
this.mesh = new Mesh(geometry, material);
我如何尝试使用偏移为纹理设置动画:
this.mesh.material.map.offset.y -= 0.001;
this.mesh.material.map.needsUpdate = true;
this.mesh.material.needsUpdate = true;
this.mesh.needsUpdate = true;
我已经确认在每个动画帧期间都会调用我用来尝试偏移的函数,但是除了我写入纹理的颜色的初始定位之外,可视化本身没有动画或显示变化。 非常感谢任何帮助:)
【问题讨论】:
标签: three.js