我正在导入一个动画机器人手的.fbx模型。我想使用蒙皮网格,但渲染gl.POINTS,而不是标准网格。
loader.load('/robot-arm-01.fbx', (object) => {
let children = object.children.map(child => {
child.material = new THREE.ShaderMaterial({
vertexShader,
fragmentShader,
skinning: true
})
let points = new THREE.Points(child.geometry, child.material)
points.position.copy(child.position)
points.scale.copy(child.scale)
points.rotation.copy(child.rotation)
return points
})
object.children = children
})
问题肯定不在我的顶点着色器中,如果我不交换子数组,我就可以播放动画
这可以用gl.POINTS正确显示我的模型,但我的动画根本没有启动。我错过了什么?
我唯一的想法是改变这三个。js mesh在运行时从gl.TRIANGLES到gl.POINTS的draw调用。人们是如何做到这一点的?有没有更明智的方法来解决这个问题?