# How to orient a layer to connect 2 points AND facing the camera

here is my question, which I hope will be in general interest:

If you have got 2 Points in 3D space and want a plane to connect those, you can quite easily use a function similar to "lookAt" to orient the layer pointing with its x-axis from one point to the other. But how can you at the same time make sure the layer is rotated in the way so that the layer is facing the camera (the maximum amount possible, of course it cant be orthogonal to the camera)? The x Axis from the resulting plane should face from the one point to the other.

• I'm not sure I understand the question. Do you mean planes instead of layers? When you say you want a layer between two points and also facing the camera, are you referring to billboarding? – TomTsagk May 21 '18 at 12:17
• yes I mean planes, I was´t aware that layers is used differently, sorry.. So what i need is the orientation of a plane between two points and also facing the camera as much as possible. – ayma May 21 '18 at 13:12

n1 = cross(B - A, C - A)