3
$\begingroup$

I have this: enter image description here

I'd like all cylinders to point to the bigger sphere on the right, while still being attached to their original spheres.

This is my set up so far:

enter image description here

If I try to use Transform to move the cylinder and rotate on the Z axis, I get:

enter image description here

Node setup: enter image description here

$\endgroup$
3
  • $\begingroup$ Basically you have set it up correctly, and the rotation should work on the Z-axis, but try to move the cylinder with Transform before the instantiation, instead of using Set Position afterwards. $\endgroup$
    – quellenform
    Commented Sep 18, 2022 at 7:12
  • $\begingroup$ Sadly that still gives me the cylinders pointing in strange directions. I'll attach an image $\endgroup$
    – Hmm
    Commented Sep 18, 2022 at 7:19
  • $\begingroup$ Please check if you have applied scaling to all objects and if you really reference the correct sphere. $\endgroup$
    – quellenform
    Commented Sep 18, 2022 at 7:49

1 Answer 1

4
$\begingroup$

If the question is about this particular case, and not a more general 'point-at' problem..

enter image description here

..to keep things simple, you could use a cone..

enter image description here

More generally, to orient cylinders, you need the vector between source position and target position:

enter image description here

.. whose length can optionally be used to make rays reach the target exactly. (Blue nodes, above)

enter image description here

The file also includes an 'instanced curves' method.

$\endgroup$
4
  • $\begingroup$ Thank so so much! This is exactly what I was looking for. Do you know how I could change the origin of the object to be at the center of the target ball? (I'm trying to align the target ball to the center of the world so that I can rotate around it with a camera) $\endgroup$
    – Hmm
    Commented Sep 18, 2022 at 10:03
  • $\begingroup$ I was referring to the more general case you mentioned $\endgroup$
    – Hmm
    Commented Sep 18, 2022 at 10:11
  • 1
    $\begingroup$ Hi @Hmm !. Everything you do in GN is to the geometry, not the object that contains it. You can't directly control the object transform from inside a modifier... but if your modified object is at the origin anyway, then just adding this to the end of the tree will nail the target to World 0. $\endgroup$
    – Robin Betts
    Commented Sep 18, 2022 at 10:24
  • 1
    $\begingroup$ Yay! It worked. Thank you again. I eyeballed it with just the Transform: imgur.com/a/Ykacfzw $\endgroup$
    – Hmm
    Commented Sep 18, 2022 at 10:35

You must log in to answer this question.

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