# Geometry nodes: How to align all object faces to camera position?

Hi Geometry nodes friends.

I would like to seperate all faces of an existing object and then align them individually to the camera pos. Like the billboard technique you may know from game engines.

It's easy to scale all object faces individually, but I don't know how to rotate them by single.

Thank you in advance Chris

• do you want them to face the camera fully, or only around one axis? Commented Apr 21, 2023 at 7:39
• Yes. This would be great. Commented Apr 21, 2023 at 10:17

## 2 Answers

btw @RobinBetts this is what it looks like:

• Excellent! I was being too clunky to think of that :D If it had been in time, this should have got the tick. Maybe it still can. Commented Apr 23, 2023 at 9:12
• Both solutions are actually right. The solution by shmuel is a bit more readable for people like me, who are "more artists than coders". But we can also learn a lot by the first solution Robin posted. Thank you both for the invested time! Commented Apr 23, 2023 at 11:14
• @RobinBetts , the way you said is probably better Commented Apr 23, 2023 at 23:21
• @ChristophWerner Glad you could change your decision! Ain't that funny? The way I'm wired up, I find this way of thinking about the problem more difficult. It took me a while to figure out why it worked. For you guys, it's the other way round. :) Commented Apr 24, 2023 at 7:24

This group:

• Finds the vector orthogonal to both the face-normal and face-to-camera vectors
• Finds the angle between the latter vectors in their common plane
• Rotates points about the vector found in step 1, passing through their face-centers, by the angle found in step 2.

.. with this sort of result:

... but @shumel has raised a good point in the comments.. you may want your faces to swivel about only one axis, say, (0,0,1).

• Exactly. But I think I'll find the solution by myself and post it here. Thank you. Commented Apr 21, 2023 at 10:17
• @ChristophWerner Thanks! If it was 0,0,1, you can forget the cross-product, just project both vectors onto XY (set Z=0) and normalize, and then find the angle via the dot-product as above. I'll plug that into the answer if you like. Commented Apr 21, 2023 at 11:21
• you could just use the align ruler to vector node instead of all that math. Commented Apr 21, 2023 at 22:15
• @shmuel I'm always up for saving a few nodes.. could you demonstrate? (If you mean Align Rotation to Vector, you have to know what the rotation is, in the first place) Commented Apr 22, 2023 at 7:29
• True I didn't think of that. Still, you can use two align euler to vector's; one with the normal(vector) and -1(factor) and a second one with the direction(vector). Commented Apr 23, 2023 at 3:27