Jump to content

Useful expressions for manipulating volumes?


Recommended Posts

I couldn't locate a good list of expressions that people might use to manipulate volumes.

What I want to do is to create a sphere that fades off as the volume expands. Sort of like a radial gradient, but spherical. I know about some of the more simple expressions linearly interpolating volumes, fading out volumes based on their X, Y, or Z position.

Maybe some of you could list your favorite expressions for manipulating volumes?

Link to comment
Share on other sites

Ah yes, I sort of went with this method after I looked through the help documentation. I still am having a problem creating what I want.

How could I roll a Volume VOP that would maybe take a voxel with an index somewhere near the center (resolution divided by two?) and decrease the density of the other voxels as their distance to that center voxel increases? Then maybe use some kind of nonlinear function to control the falloff.

Or am I treading down the wrong path?

Edited by mightcouldb1
Link to comment
Share on other sites

if you have default volume which center is at 0,0,0

then P of the voxel will be vector from the center of the volume and its length will be distance from the center

then you can just resample that distance to 1-0 range according to desired max distance(radius of the sphere) to get linear decrease of density from center of the sphere

look at the attached file for example of this method

you can then append ramp parameter after it to tweak the falloff

volumeVopExample.hip

Link to comment
Share on other sites

You could also check out the isosurface SOP, which allows you to enter formulas using $X, $Y, $Z so in this case I think a unit radius sphere that builds to the centre will be something like max(1 - ($X * $X + $Y * $Y + $Z * $Z), 0).

I did a couple of videos on volumes that cover the very basics of this on Vimeo, there's a link on the odforce tutorial page.

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...