4
$\begingroup$

Hi I want to create animation of jetstreams where one side of the jetstream is red color indicating hot air while other side of jetstream is blue color indicating cold air.

The boundary between the red color and blue color should vary based on location of the curve on sphere. If curve moves up or changes shape then boundary between these two colors should also Change.

Please refer to figures below, I want to to make this dynamic. Any method geometry nodes, animation nodes will work.

Thanks in advance

enter image description here enter image description here

$\endgroup$

2 Answers 2

5
$\begingroup$

General idea: sort "cold" and "warm" vertices into two groups with signed distance from the curve. This allows the shader to draw a sharp line without being restricted to exact vertex locations. We can find the inside and outside of the curve by turning it into a mesh surface and then finding the closest point in that surface for each sphere vertex.

Blend file for 3.1 release

Blend file for 3.3 alpha

  1. I start with a mesh sphere and a curve object. I put the curve close the surface, but it doesn't have to be precise, can intersect a bit. I tried shrinkwrap on the curve but it creates ugly artifacts at higher curve resolution, and isn't needed. enter image description here
  2. Add a geometry nodes modifier to the sphere. This takes in the curve object to create that separation surface. I use the vertex position to extrude outward from the center. The "Face Orientation" overlay helps to check which side is the "inside", this can be changed by flipping the direction of the curve. enter image description here
  3. To find the signed distance, use the "Transfer Attribute" node. We want both the position and the normal of the divider surface for each of the sphere verts. Then we can compute the distance with a bit of vector math: vector from the closest point on the divider, the dot product with normal then gives the distance in that direction. Notice the positive and negative values in the spreadsheet, some points are inside and some outside as we would expect. enter image description here
  4. And finally i make a shader to display the signed distance in nice colors. Use the Attribute node to read our custom vertex distance values. The shader will interpolate the value accross the face. The "Map Range" shader node can be used to feather out the value a bit, or use a "Less Than" comparison for a sharp line. Don't forget to assign the material in the geometry nodes too. enter image description here

enter image description here

$\endgroup$
3
  • $\begingroup$ A really nice simple solution with an elegant little bit of math in the middle. I think there may be a problem with the Blender depsgraph. If I try to shrink-wrap the curve (so it enters your tree as a mesh,) I can't persuade it to behave during/after edit without kicking it in the Shrinkwrap modifier by toggling between 'Modify as Mesh' and 'Modify as Curve' modes.... imgur.com/a/mLnQQWd I wonder if that's reportable. $\endgroup$
    – Robin Betts
    Jun 2, 2022 at 9:09
  • $\begingroup$ +1 great solution, great answer and with blend files ....would give +10 if i could $\endgroup$
    – Chris
    Jun 2, 2022 at 9:30
  • $\begingroup$ Thanks a lot, for the solution and blend file, as chris mentioned i would give you +10 if it was possible $\endgroup$
    – jai ho
    Jun 2, 2022 at 13:03
0
$\begingroup$

we can use this method now

https://www.youtube.com/watch?v=d9NUozH257g

it also allows you to push the lil arrow graphics along the front :D

$\endgroup$

You must log in to answer this question.

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