THREE.js - Billboard Vertex Shader

前端 未结 1 2076
后悔当初
后悔当初 2021-01-06 18:08

I have the need to orientate an instance of THREE.Mesh to always face the camera. I know I could just use the [THREE.Mesh].lookAt() method, but I\'m trying to work on my GLS

相关标签:
1条回答
  • 2021-01-06 18:28

    Apparently this works:

    gl_Position = projectionMatrix * (modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0) + vec4(position.x, position.y, 0.0, 0.0));
    

    I'm actually trying to figure out how to do axis aligned billboards.

    0 讨论(0)
提交回复
热议问题