Reactive particle wind

   5760   9   1
User Avatar
Member
164 posts
Joined: Feb. 2014
Offline
I want my wind to react to where the particle are. So if they're below P.y 0 then it pushes them up and visa versa. I've got Vop Sop to work but not the code.

My Vex is:
if P.y = < 0 {
wind.y = 1
}
else
{wind.y = -1
};

and my Pop Vop looks like this:

Is it just a personal preference to use code or nodes? And what would be the best way to approach this?

Also would you generally use a Vop Sop to effect a Pop Wind or is the Vop Sop a replacement?

Thanks
http://simonfarussell.com [simonfarussell.com]
User Avatar
Member
443 posts
Joined: Sept. 2012
Offline
Almost all popdops have field called Use VEXpressions.
Instead of writing it in new popwrangle write it in popwind itself.

Just turn on Use VEXpressions.
User Avatar
Member
443 posts
Joined: Sept. 2012
Offline
I've got Vop Sop to work but not the code.

Why popwrangle doesn't work? Because it doesn't know windx, windy and windz parameters.

If you really want to use popwrangle then you need to bind wind to an attribute.
User Avatar
Member
443 posts
Joined: Sept. 2012
Offline
and my Pop Vop looks like this:

equivalent of your voppop in vex:

if @P.y = < 0
@force = {0, 1, 0};
else
@force = {0, -1, 0};
User Avatar
Member
443 posts
Joined: Sept. 2012
Offline
PradeepBarua
Almost all popdops have field called Use VEXpressions.
Instead of writing it in new popwrangle write it in popwind itself.

Just turn on Use VEXpressions.


here is code:

if(@P.y < 0)
wind = {0, 1, 0};
else
wind = {0, -1, 0};
User Avatar
Member
443 posts
Joined: Sept. 2012
Offline
efficient way to write if use want to use slider:

if(@P.y < 0)
wind += {0, 1, 0};
else
wind += {0, -1, 0};


this way you can control wind force by Wind Velocity parameter. It will get added to existing value.
User Avatar
Member
164 posts
Joined: Feb. 2014
Offline
This is perfect, thanks all.

I struggle with syntax, I'm a lot more use to Xpresso in Cinema 4D so semi-colons befuddle me.
http://simonfarussell.com [simonfarussell.com]
User Avatar
Member
8519 posts
Joined: July 2007
Online
if you use POP Wind and set Wind Velocity to 0,1,0
(or the y magnitude instead of 1)
then the simplest VEXpression you can do is probably

wind.y *= @P.y>0?-1:1;

also be careful when doing your own VOPs/Wrangles, @force is not behaving like wind, there is Add Wind Force VOP to mix wind forces, but anyway in many cases it's much easier to just tweak POP Wind
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
164 posts
Joined: Feb. 2014
Offline
tamte
then the simplest VEXpression you can do is probably

wind.y *= @P.y>0?-1:1;

I think it's the shortest not the simplest!
So this is a sort of shorthand notation?
http://simonfarussell.com [simonfarussell.com]
User Avatar
Member
443 posts
Joined: Sept. 2012
Offline
Yes, it's short form of if() conditional statement.

var = (condition) ? true value: false value;
  • Quick Links