Jump to content

Recommended Posts

Hello,

How do I grab the position of a volume from another input in a volume vop? If I create a bind node and set it to P, it lets me get the position of the volume in input 1. How can I get the position from a volume in input 2 or 3?

Thanks

pos.PNG

Share this post


Link to post
Share on other sites

Bind P gives you position of the current voxel you are iterating over, since you are iterating over voxels of the first input it's always first input, and you can sample any volume primitive of any input at that position 

if you want to get position of a particular voxel index from a primitive of current or other inputs, you can use volumeindextopos() function and feed either specific index you have in mind or if the voxel grids are the same dimensions just transformed differently you may want to feed the current index to get position of corresponding voxel in other input or volume primitive, up to you

  • Like 1

Share this post


Link to post
Share on other sites
15 minutes ago, anim said:

Bind P gives you position of the current voxel you are iterating over, since you are iterating over voxels of the first input it's always first input, and you can sample any volume primitive of any input at that position 

if you want to get position of a particular voxel index from a primitive of current or other inputs, you can use volumeindextopos() function and feed either specific index you have in mind or if the voxel grids are the same dimensions just transformed differently you may want to feed the current index to get position of corresponding voxel in other input or volume primitive, up to you

Thanks! how do I get the current index value? I had tried using the volume index to position, but I got stuck on what to feed into the indexpos. Thanks again.

 

edit: I just found out its the ix iy iz value on the volumevopglobal

Edited by ejr32123

Share this post


Link to post
Share on other sites

I still cant figure out how to sample the position of a volume from the second input : (

Share this post


Link to post
Share on other sites

Check this.
There's two examples in here.
Be careful that there are two types of volumesamplefile nodes.
volumesample and volumesamplevector.
For position and color you obviously choose the vector one.

 

volumesample.hipnc

Share this post


Link to post
Share on other sites

Thanks, that doesnt seem to solve my problem of grabbing the position from another input of a vop. Also example levelset doesnt work because it starts by merging something that doesnt exist.

Share this post


Link to post
Share on other sites
6 hours ago, ejr32123 said:

edit: I just found out its the ix iy iz value on the volumevopglobal

do you still have problem using volumeindextopos() to get the position of that index from specific input and primitive even after this discovery?

you can either plug those 3 to Integer To Vector or use Volume Pos To Index to get the index vector and then use that to get position of a voxel of the same index in any volume prim/input using Volume Index To Pos VOP

 

Share this post


Link to post
Share on other sites

 @anim Yea, I am still having the problem. TBH I don't dont really know what the volume index is, and I dont know where to learn what it is. I tried checking the manual. The photo is how I tried setting it up. I don't understand why its not just like "import point attribute" where you choose input and the attribute to import.

noise.PNG

Edited by ejr32123

Share this post


Link to post
Share on other sites

Here you get the idx of the current volume.

May be like this.

 

Capture.JPG

Edited by flcc

Share this post


Link to post
Share on other sites

Maybe it would help if you described the problem you are trying to solve? TBH I'm not sure what you mean by grabbing the position of a volume on a different input. The Volume VOP iterates over the volumes in the first input by position, so there is only one position P of interest at any time. There are no other positions being generated for the other inputs.

Now, if you have a specific position to look up in the volume in input 2 (e.g. the current P + some offset), you can use the Volume Sample node to read the second input's volume at some arbitrary position. 

Share this post


Link to post
Share on other sites

That's a good point, actually, this setup just return P !

But why make it simple when you can make it complicated ? :lol:

Share this post


Link to post
Share on other sites
21 minutes ago, ziconic said:

Maybe it would help if you described the problem you are trying to solve? TBH I'm not sure what you mean by grabbing the position of a volume on a different input. The Volume VOP iterates over the volumes in the first input by position, so there is only one position P of interest at any time. There are no other positions being generated for the other inputs.

Now, if you have a specific position to look up in the volume in input 2 (e.g. the current P + some offset), you can use the Volume Sample node to read the second input's volume at some arbitrary position. 

I have a "rest" field going into the third input of my photo. I want the position of the static noise to be based on the position of the volume in the third input, not the position of input 1. ITs just like using import point attribute from another input and grabbing position, but trying to do it for a volume.

Edited by ejr32123

Share this post


Link to post
Share on other sites
1 hour ago, ejr32123 said:

I don't understand why its not just like "import point attribute" where you choose input and the attribute to import.

it is exactly like that, import point attribute, you provide input and point index and it will import attribute (P for example) from that input/point

the same way as providing  input and voxel index can return position of that voxel using volumeindextopos()  which you can use to sample value of that volume primitive

that's providing you don't know the position you want to sample the volume at already, it's possible that you don't really want position based on index, but that's hard to tell from what you have said so far

it's also not very common to have to do that, but as mentioned in the first response you may have the same dimension volume primitive just with different transform and you want to get the location of corresponding voxel, or your volumes may be misaligned a bit like when v@vel field is simmed face sampled and you want to get position and then values of exact voxels rather than the interpolated values at the position of voxels in first input, but if that is not similar to your situation it may be not what you are looking for

  • Like 1

Share this post


Link to post
Share on other sites
7 minutes ago, ejr32123 said:

I have a "rest" field going into the third input of my photo. I want the position of the static noise to be based on the position of the volume in the third input, not the position of input 1. ITs just like using import point attribute from another input and grabbing position, but trying to do it for a volume.

it's not exactly just like that, cause while point's hold the values and move themselves, voxels are static and values move from one to another

so that's why you can't just import position from another input and hope that you get the right one 

but if you have evolving rest filed in your first input just bind that and use to sample the noise

or if it's in the 3rd input you can use Volume Sample Vector VOP to sample 'rest' and use for your noise, still assuming your rest field is evolving and aligned with the sim or volumes you are applying noise to

Edited by anim
  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×