Jump to content

volume position


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

Link to comment
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
Link to comment
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
Link to comment
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

 

Link to comment
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
Link to comment
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. 

Link to comment
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
Link to comment
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
Link to comment
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
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...