Particle banking rotation

   2744   4   0
User Avatar
Member
11 posts
Joined: May 2016
Offline
Hi all,

I'm having a difficult time adding smooth banking rotation to particles. From the older threads that I looked at like this one [www.sidefx.com], it seems the popular recommendation is smoothing in CHOP's, however I'm trying to avoid this route because my understanding is CHOP's isn't multi-threaded and doesn't scale well.

Attached is the test file that I've been working on. I have the bank angle set to the magnitude of the XZ acceleration. Is there an operator or VEX expression that will smooth an attribute over time? Any help or hints would be greatly appreciated.
Edited by JoshFoster - Oct. 3, 2018 12:37:37

Attachments:
banking_test.hipnc (234.0 KB)

User Avatar
Member
2537 posts
Joined: June 2008
Offline
Check out the lerp function.
http://www.sidefx.com/docs/houdini/vex/functions/lerp.html [www.sidefx.com]

Or maybe the AttributeBlur node.

The problem may be in this line.
f@bank_angle = fit(angle, -PI/2, PI/2, -PI/5, PI/5);
If you examine the result of angle you will discover that is can exceed the range values you have specified. When that happens, you are losing resolution in your values and the fit will act a bit like a clamp. It might be better to clamp the xy_accel_mag so the resulting angle falls within the fit range.

Is bank_angle output supposed to be in radians?
Edited by Enivob - Oct. 4, 2018 10:27:54
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
2537 posts
Joined: June 2008
Offline
The jitter does seem to be related to the distance from curve. When I copy a few boxes along the path I can see that the boxes closest to the curve points exhibit less jitter on banking than the ones farther away from the curve/path.

Attachments:
orient_jitter.gif (636.8 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
192 posts
Joined: Nov. 2008
Offline
howdy josh. a relatively efficient but somewhat brute-force way to do this would be to blur your input velocity over time. here's an example of averaging your velocity between seven frames that seems to eradicate your jitter.

Attachments:
bb_banking_smooth.hipnc (291.4 KB)

User Avatar
Member
11 posts
Joined: May 2016
Offline
Looks like smoothing out the velocities did the trick! Thanks Brian for posting your scene file. I modified it by throwing the time shift into a loop. And thanks Enivob for the heads up about the bank angle clamping issue. I updated that as well.
Edited by JoshFoster - Oct. 8, 2018 15:42:38

Attachments:
bb_banking_smooth_2.hipnc (253.7 KB)

  • Quick Links