nosferatu_037 Posted June 8, 2016 Share Posted June 8, 2016 Hey guysIve been trying this for a while now, but i still am not able to solve it.Other than converting a grid to a volume and running a volume analyse sop, how would one calculate curl of velocity on a grid sop using an attribute wrangle.Ive setup a simple grid and ran it thru a pointvop in which ive just plugged in the output of a curl noise vop into v. Now i just want to calculate the curl of v using just the attribute wrangle using neighbours() vex function.So far ive managed to calculate the gradient of each v component, but the rest of math i cannot translate to proper code. Any ideas?p.s. does anyone have resources how to move from math notations to codeThanks Quote Link to comment Share on other sites More sharing options...
animatrix Posted June 8, 2016 Share Posted June 8, 2016 You can use this VOP: https://www.dropbox.com/s/sueuvx8b6936odk/Curl_VOP_Animatrix.otl?dl=0 Quote Link to comment Share on other sites More sharing options...
nosferatu_037 Posted June 8, 2016 Author Share Posted June 8, 2016 Thanks Pusat But that vop relies on volumes and inside its just a simple volumegradient, like i mentioned, id like to find out how to do the same thing without using volumes and how the math would translate into code. Quote Link to comment Share on other sites More sharing options...
animatrix Posted June 8, 2016 Share Posted June 8, 2016 In that case, I would probably use edge connectivity or point clouds and get the point with the maximum v.x, v.y, v.z separately from the current point, and then calculate a vector that goes from the current point to the point with the max value. Then you can replace the gradient vectors with these vector values. Quote Link to comment Share on other sites More sharing options...
nosferatu_037 Posted June 8, 2016 Author Share Posted June 8, 2016 Yeah i actually did exactly the same, the problem is i would get completely different results compared to a vdb analysis sops curl operator. Thats why i thought i was doing something wrong math wise, or i just didnt understand the notation really well. I just used the neighbours() vex command to extract the points sharing the same edge, and went to build a gradient for each v component. I got a 3x3 matrix with the gradient vector components in it, and did the same subtraction like in that example you sent, but it looked so different from volume curl, i couldnt figure out why. Quote Link to comment Share on other sites More sharing options...
deniz Posted June 8, 2016 Share Posted June 8, 2016 (edited) you get the curl if you take the cross product from your vector and gradient, if you want compute the gradient from a grid in vex, you have a ode with 2 components x,y and you can compute the gradient for each component, but if you have 3 components and they depending from eachother like a vectorfield, you can use a gradient descent (jacobian) algorithm it does the exact same thing what sensei pusat described to compute the partial deriative, to get the gradient for a vectorfield with x,y,z, its my understanding i can be wrong Edited June 8, 2016 by deniz Quote Link to comment Share on other sites More sharing options...
petz Posted June 14, 2016 Share Posted June 14, 2016 if you are talking about a tangent vector field than it´s fairly easy to calculate by basically summing up angles. if its not a tangent field it would be much harder to discretize but also wouldn´t make much sense anyhow ... hth. petz curl.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.