3
$\begingroup$

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

$\endgroup$
2
  • 2
    $\begingroup$ do you want them to face the camera fully, or only around one axis? $\endgroup$
    – shmuel
    Apr 21 at 7:39
  • $\begingroup$ Yes. This would be great. $\endgroup$ Apr 21 at 10:17

2 Answers 2

5
$\begingroup$

btw @RobinBetts this is what it looks like: enter image description here

$\endgroup$
4
  • $\begingroup$ 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. $\endgroup$
    – Robin Betts
    Apr 23 at 9:12
  • 1
    $\begingroup$ 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! $\endgroup$ Apr 23 at 11:14
  • $\begingroup$ @RobinBetts , the way you said is probably better $\endgroup$
    – shmuel
    Apr 23 at 23:21
  • 1
    $\begingroup$ @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. :) $\endgroup$
    – Robin Betts
    Apr 24 at 7:24
4
$\begingroup$

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.

enter image description here

.. with this sort of result:

enter image description here

... 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).

$\endgroup$
6
  • $\begingroup$ Exactly. But I think I'll find the solution by myself and post it here. Thank you. $\endgroup$ Apr 21 at 10:17
  • 1
    $\begingroup$ @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. $\endgroup$
    – Robin Betts
    Apr 21 at 11:21
  • $\begingroup$ you could just use the align ruler to vector node instead of all that math. $\endgroup$
    – shmuel
    Apr 21 at 22:15
  • $\begingroup$ @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) $\endgroup$
    – Robin Betts
    Apr 22 at 7:29
  • $\begingroup$ 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). $\endgroup$
    – shmuel
    Apr 23 at 3:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .