Jump to content

Sum of attributre over ten frames?


Recommended Posts

Hey all, I am quite new to Houdini and am wrestling with an issue.

I have used table import to add a list of values to a set of primitive's attributes. The attributes of the primitives is then set to change to the next columns value in the list every ten frames. I then poly extrude by this value. Therefor each primitive extrudes by the value it has been individually given which changes every ten frames.

This however means that the animation is not smooth and jumps every ten frames. The best way I thought to smooth this was to find the sum of the current frame and following 9 frames and then dividing this value by ten. Therefore finding the average value over the ten frames and smoothing the transition between values.

Is it possible to write such an expression? If so how would it look?

Cheers

Link to comment
Share on other sites

Hi Alex, VEX already supplies a function called spline() for smoothly interpolating values.

// INPUT ARRAY FROM 2ND INPUT
f[]@heights = detail(1, "heights", 0);
int l = len(@heights);

// ADD FIRST AND LAST ELEMENTS to be ignored by spline-function
insert(@heights, 0, 0.0);
append(@heights, 0.0);

// INTERPOLATE VALUES
int change = chi('change_rate');
float t = (@Frame - 1) / float(change) / l;
f@height = spline("cspline", t, @heights);

// OUTPUT
@P.y *= @height;
@Cd = set(@height,0,1);

interpolate_array_values.hiplc

Edited by konstantin magnus
  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Hey Konstantin,

Thanks a lot for your rapid response, really appreciate it and sorry for taken ages to respond myself.

Thought I'd give you an update. I tried to work with your advice, but because my ability with VEX is still quite week, I've ended up instead using a chop network to create a smooth extrusion for the values. I've attached my files beneath, including the CSV my file is reading the data from, a digital asset which helps me filter through the columns of the CSV.

Cheers

180616_Interface.hipnc

Unemp_50_Years.csv

Create_Individual_Triangle.hdanc

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...