4
$\begingroup$

I want to place planes facing all the same direction on a tube/cylinder which positioned horizontally using the Geometry Nodes. I could do this if I didn't apply rotation after turning 90 degree. However, it flips half of them in opposite direction if I applied the rotation.

Does anybody know why this happen and how to fix it?

I'm just worried if "not applying rotation" cause problems when exported to Unity etc...?

planes placed around a cylinder

rotated 90 degree on X

apply rotation

applied rotation

turned 90 degree but why half of them are facing opposite?

$\endgroup$
2
  • $\begingroup$ As far as I know you cannot import the Geometry Nodes into Unity, so have to make a mesh of those planes... and in a regular mesh the normals can be flipped so if everything else fails you could do it manually. $\endgroup$ Jan 17 at 9:09
  • $\begingroup$ Thank you very much! I'll make sure to convert to mesh when I export for other programs. $\endgroup$
    – yuki shima
    Jan 17 at 9:36

2 Answers 2

5
$\begingroup$

Note what the documentation for the Distribute Points on Faces Node says about the Rotation output:

An XYZ Euler rotation built from the normal attribute for convenience. Such a value can also be built from the normal with the Rotate Euler Node. Keep in mind that the Z axis of the result rotation will be arbitrary, since the mesh normal used to create the rotation does not have enough information to set all three rotation axes.

Emphasis mine. The rotation of your planes is not fully-determined by the surface normal of your cylinder, and it cannot be, since there is no way to know what direction “up” should be for each plane (only what direction “out” should be).

If you need to guarantee the planes will always be placed facing the same direction, you’ll need to use the normal in combination with some other vector to compute an unambiguous rotation. For example, you could choose to make the planes always face “upwards” according to the object’s local Z axis:

This results in the following when the object is rotated:


However, this is probably not what you want, since you presumably want the “up” direction for the planes to all point towards one end of the cylinder. Unfortunately, there isn’t really any consistent way to get that information—the concept doesn’t make terribly much sense for an arbitrary mesh. However, you could in theory compute it based on the relative positions of the top and bottom ends of the cylinder, like this:

This requires creating two vertex groups, one that contains the cylinder’s top vertices and another that contains the bottom ones, and passing those groups as the appropriate inputs. This results in the behavior I suspect you want:

However, this is a bit of a silly thing to do, and just not applying the rotation is probably a better choice.

$\endgroup$
1
  • $\begingroup$ Wow... Thank you very much for the informations and examples! That is amazing!! $\endgroup$
    – yuki shima
    Jan 16 at 19:34
0
$\begingroup$

I think you can get the rotations from normals.

enter image description here

Default rotations work not so well because the target axis is Z. But in Align Euler to vector you can set up the target axis manually.

$\endgroup$
2
  • 1
    $\begingroup$ This doesn’t really work—the other axis is unconstrained, so you sometimes get weird results. (See my answer for why, as well as a workaround.) $\endgroup$ Jan 16 at 18:57
  • $\begingroup$ Thank you both very much for answering my question so quickly. It really helped me understand how some nodes works. $\endgroup$
    – yuki shima
    Jan 16 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.