Plane always look into camera

Is there a way to make a plane always face into camera/screen direction just like an billboard?

Hi!
Try
plane.quaternion.copy(camera.quaternion);

3 Likes

You can do it with vertex shader, here is an example https://jsfiddle.net/qgu17w5o/162/

Or you just use THREE.Sprite.

https://threejs.org/examples/webgl_sprites.html

2 Likes

I get:

three.module.js:3774 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'x') at Quaternion.copy

this only works if the object is at the root without nesting. if it’s wrapped by a group for instance which has a rotation it won’t face the camera. can this be fixed somehow?

edit:
i think i’ve figured it out, by wrapping the object into a group with both matrixAutoUpdate and matrixWorldAutoUpdate set to false:

    parent.updateMatrix()
    parent.updateWorldMatrix()
    parent.getWorldQuaternion(q)
    object.quaternion.copy(camera.quaternion).premultiply(q.invert())