Over a million developers have joined DZone.

Using Houdini VOPs to Deform Geometry

DZone's Guide to

Using Houdini VOPs to Deform Geometry

Simon Gladman's demo project uses a VOP to deform the geometry of a sphere to look like an animated alien sea urchin.

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

Houdini VOPs, or VEX Operators, are networks that use a visual programming paradigm to create operators that can, for example, deform geometry, define material shaders or generate particle systems. There is a huge range of nodes available inside a VOP — everything from programming logic (e.g. conditionals and loops) to maths (e.g. dot and cross products) to domain specific operators for geometry and shaders.

My little demo project uses a VOP to deform the geometry of a sphere to look like an animated alien sea urchin. This geometry is then converted to a rigid body and the animation of its spiky protrudances moves it around the scene.

The main geometry node is pretty basic - a subdivided sphere feeding into an Attribute VOP:

It's inside the VOP that things get interesting.

  1. By default, a VOP is populated with a global parameters node. The position (P) and frame (Frame) parameters are used to drive the animation.
  2. The turbulent noise node is set to alligator noise and given an attenuation of 1.5.
  3. The output of the noise is used to displace each incoming point along its normal.
  4. To color the geometry, the output of the turbulent noise will be multiplied by 25 - this parameter node contains that value.
  5. The multiply node multiplies the noise value by the parameter value.
  6. A color mix node interpolates between yellow and blue based on the multiplied noise value.
  7. Finally, the displaced point position and the color are piped into the VOP output.

I used the RBD Object shelf tool to convert my animated, displaced sphere into a rigid body. To have the physics working nicely with the animated geometry, "Use Deforming Geometry" is checked inside the RBD Object node inside the generated DOP Network.

And that's it! It actually looks as if VOPs are so powerful, one could avoid ever writing a line of VEX again — much like my Sweetcorn app!

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

houdini ,vop ,vex operators

Published at DZone with permission of Simon Gladman, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}