1
$\begingroup$

enter image description here enter image description here

I have a cone which is being positioned relative to the face which has points distributed on it. I want it to animate on the normal position of that face. The problem I had was that it always starts at the world origin regardless of which face I choose to use.

I tried to add a capture attribute node but this outputs a field, I have tried various ways to change this to a single vector so that I can position the cone in the centre of the face I choose via the index.

How would I modify my node tree to achieve this?

$\endgroup$
7
  • 1
    $\begingroup$ Try to plug "an Index selector" (just an Input/Constant/Integer node) in the "Sample Index" nodes following the "Distribute Points on Faces" node to specify the face you are targetting, instead of leaving the "Index" socket unplugged. I am running out of time for details right now, but could you have a look to this answer ? I think it might help you. $\endgroup$ Jan 19 at 6:32
  • 1
    $\begingroup$ About the "red" link, I strongly recommend to read this post: Why is there a red line when I try to connect one node to another? $\endgroup$ Jan 19 at 6:36
  • $\begingroup$ @StefLAncien thanks for helping me here, I have tried an integer in the Sample Index nodes but still doesn't work for me. Will this actually select a face as the Distribute Points on Faces node ouputs points not a mesh. Maybe i'm just not getting it. $\endgroup$
    – Neil
    Jan 19 at 10:15
  • 1
    $\begingroup$ Could you provide your Blender file using blend-exchange.com to give it a try ? $\endgroup$ Jan 19 at 11:20
  • $\begingroup$ just add a set position node before or after (i am not totally sure which is right) and then plug in the end of the red line to the offset of that node. Then it should work. -> this only solves the "red line" problem, pls provide blend file $\endgroup$
    – Chris
    Jan 19 at 11:41

2 Answers 2

1
$\begingroup$

(Using Blender 3.6.5)

Objective

To animate a single cone along the normal of a selected by index face. Animated cone

Geometry Nodes graph

GN Graph 1. The targetted face is identified by its Index. For the demo, an Input/Constant/Integer node is used.
2. The face centre coordinates are recovered from the receiving geometry using a Sample Index node set in Face domain and linked to a Position node.
3. The face normal coordinates are recovered from the receiving geometry using an other Sample Index node set in Face domain and linked to a Normal node. This vector is converted to a rotation through an Align Euler to Vector node. Its Axis property is set to Z because the cone axis is aligned to Z axis.
4. The cone periodic displacement along the normal, between 0 and 1, is computed as: $$ \frac{1}{2} \left\{ \sin{(\omega t)} + 1 \right\}$$ where $t$ is the frame count. With $\omega$ set to 0.15, the oscillation period is $2\pi/\omega=42$ frames.
5. The unitary displacement vector is computed by rotating the unit vector along the cone axis (i.e. Z axis) with a Vector Rotate node. (NB: the normal from step 3 could be used instead).
6. The position of the cone origin is computed by adding the scaled displacement to the face centre position.
7. A Transform Geometry node is used to specify the position and the orientation of the cone.

Resources

$\endgroup$
1
  • $\begingroup$ This does what I need and works with my setup also, thank you. $\endgroup$
    – Neil
    Jan 20 at 13:20
1
$\begingroup$

check this out:

enter image description here

result:

enter image description here

i separate the face as you did, then distribute faces on that face and then just instance cones on the points and adapt rotation via align euler to vector. Hope it helps.

$\endgroup$
1
  • $\begingroup$ As usual you were helpful, but I wanted the cone to be on a particular face which is why accepted a different answer. $\endgroup$
    – Neil
    Jan 20 at 13:21

You must log in to answer this question.

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