curve force

Discussions about SOFTIMAGEs© Interactive Creative Environment©
Post Reply
User avatar
sant0s
Posts: 353
Joined: 05 Sep 2011, 22:57
Location: São Pedro de Moel

curve force

Post by sant0s » 04 Nov 2016, 22:23

hey SI'lers,

actually, I guess thats a really simple question - but somewhere I have a logical prob.

Long time ago, I followed this tutorial here: https://vimeo.com/1313863

The points are driven by the curve and as closer to the curve, as more speed.

Used that technique alot for different things.

Today I was trying to modify it with 2 more curves that will controll the distance and flow speed from the main curve.

I'll attache an image to explain what I mean.

I was trying to get the distance bewtween the middle curve and the two outer curves, rescale that and use that as a new force to drive the points.

But its totally messing up the force.

My goal is, that as closer the points get to the outer points, as slower the move.

Thy alot!
Attachments
flow.jpg

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: curve force

Post by Mathaeus » 05 Nov 2016, 03:12

So how you connected these additional curves. Usually there's 'get closest location' node inside compound. If all three curves are connected at once, using 'group' node or something, it just takes the closest one, and that could be different curve, during time.
If there's a sort of modulation along distance/fallof to curve in compound, maybe it is easiest and safest way to have a three compounds, plugged one after another. First one to get a force from central curve. Second and third for modulator curves, having a slightly smaller, negative influence (just multiply the output of compound by -1).

User avatar
sant0s
Posts: 353
Joined: 05 Sep 2011, 22:57
Location: São Pedro de Moel

Re: curve force

Post by sant0s » 05 Nov 2016, 14:27

hey :)

yea, actually I used the "get closest location" to have the simple flow.
than I thought, I can get the distance between the middle curve and the outer curves and feed that.
I tried to get the distance between the curves with the "get closest location", plug that into a rescale and use that to get a result.
The way I try to get the distance between the curves and use that as the fallof is wrong, I know - I just dont get it :D
the first picture shows, whats wrong.
Attachments
confused.jpg
aktuell.jpg

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: curve force

Post by rray » 05 Nov 2016, 15:51

just an idea for a different approach, don't know whether feasible or not
look up closest location on central curve, then get U attribute at that location
use same U's on other curve to get corresponding points
do interpolation based on angles and distance
-rr
softimage resources section updated Jan 5th 2024

User avatar
sant0s
Posts: 353
Joined: 05 Sep 2011, 22:57
Location: São Pedro de Moel

Re: curve force

Post by sant0s » 06 Nov 2016, 02:52

hey ray,
I dont understand your idea. :)
just testing around with U's and so on, but dont know how to use it.

for now I just have a cheap solution... cached the particle flow and used a lattice to deform it.
not the perfect way but working.

User avatar
Tekano
Posts: 488
Joined: 09 Jun 2009, 14:49
Location: London, UK

Re: curve force

Post by Tekano » 07 Nov 2016, 16:27

I think the simplest solution for this is to affect each particles drag force by proximity to the two outer curves. eg closer to outer curve = more drag.

for you to calculate the distance between curves you would either need an ice tree on each curve calculating the relative distances beforehand to feed to your particles or, as rray mentions some kind of point U reinterpretation.

btw did you see this tutorial for multiple curve forces by pooby?

https://vimeo.com/36709750
Gossip is what no one claims to like, but everybody enjoys.

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: curve force

Post by Pooby » 07 Nov 2016, 17:07

Yes If you have some kind of vector field that 'holds' the force, you can apply as many curves to the field as you want, and smooth the vector flow out across the field as you need.

the 'field' could be a mesh, or a 3D grid of particles if you don't want it just working across a surface.

Doing it by curves alone might seem easier, but its harder to work out the interpolation across spaces between the curves, as you'd need to assess every curve in the vicinity, and work out the influence with a home made interpolation algorithm.
By doing it on a field, you can let ICE do the hard work. The points/vertices in the field can just get the tangent of the nearest curve, store it as say 'self.tan' Then average neighbours 'tan' attributes to create a 'flow' as seen in the video above.

Then your particles just have to 'getclosest' 'tan' from the field object and use that as the force.

User avatar
sant0s
Posts: 353
Joined: 05 Sep 2011, 22:57
Location: São Pedro de Moel

Re: curve force

Post by sant0s » 07 Nov 2016, 17:57

ahhh, thank you guys, I think its working now!!! :)

I took the outer curves and calculated the distance between them and points and multiplyed that with the tangent stuff.
The tan is like Pooby mentioned, calculated on a grid and than used it to force the particles.

only "problem" was, that outside the curves the points started moving again faster - so I used Milan's compound "Execute InOut Curve".

I'll attache an image, maybe you have some better ideas/improvements.

muito obrigado! :)
Attachments
vector_curve_flow.jpg

User avatar
rray
Moderator
Posts: 1774
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: curve force

Post by rray » 07 Nov 2016, 19:28

Nice solution. I think what I had in mind can't be used for this application. What I meant was you can use the U value you found on the central curve to look up the same U value on the other curves using "UV to location". But using this would distort your field unless you place the curves very carefully. Maybe it's useful for another case.
softimage resources section updated Jan 5th 2024

User avatar
sant0s
Posts: 353
Joined: 05 Sep 2011, 22:57
Location: São Pedro de Moel

Re: curve force

Post by sant0s » 13 Nov 2016, 15:48

hey ppl,
if anybody is interested, I made a little scene with the curve flow stuff.
the flow is based on Paul Smith's aka Poobys Tutorial on Vector Flow, so thx for that again :)

the outer curves now outomatic follow the outer edge of the riverbed.
the vector_flow model can be used to position the river level.

i created the outer curves by plotting a new curve with lots of points that the curve shrinks nicly into the riverbed.

i tried to do the vector stuff directly on the riverbed, but the vector will mess up all directions.
if anyone has a better idea about doing that stuff more easy, I am interested.

the controll inputs in the compounds are a bit messy, but its quite easy to understand, so just test around.

greetings,
sant0s
Attachments
curve_flow_emntwicklung_v1a.7z
(197.8 KiB) Downloaded 108 times

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests