据我所知,应该可以使用 MeshStandardMaterial 在 Three.js 中定义类金属材料,它应该遵循 pbr-roughness-metalness-workflow 但我找不到任何关于如何实现这一点的好例子。
我不能使用 Phong-Shader,我必须坚持使用 MeshStandardMaterial。
我想实现这样的目标:

我正在尝试在 node.js 和 python-shell 之间进行通信。我能够从 python-shell-object 接收数据,但是当我尝试向 python-shell 发送消息时,它崩溃了。
我的 app.js:
var PythonShell = require('python-shell');
var options = {
scriptPath: '/home/pi/python'
};
var pyshell = new PythonShell('test.py', options, {
mode: 'text'
});
pyshell.stdout.on('data', function(data) {
pyshell.send('go');
console.log(data);
});
pyshell.stdout.on('data2', function(data) {
pyshell.send('OK');
console.log(data);
});
pyshell.end(function(err) {
if (err) throw err;
console.log('End Script');
});
Run Code Online (Sandbox Code Playgroud)
和我的 test.py:
import sys
print "data"
for line in sys.stdin:
print "data2"
Run Code Online (Sandbox Code Playgroud)
我基本上想按时间顺序进行交流:
另一个问题:在https://github.com/extrabacon/python-shell上的教程中写道,您必须编写 pyshell.on() 以等待数据,而在源代码中作者编写 pyshell.stdout。在()。这是为什么?
谢谢!!!(纠正了python中的错误缩进)