say i wished to find the vector between one particle and all the others in the flock, would anyone be able to suggest how to access the P of the ‘other’ particles in the vex expression?
say a bit like this
vector myTotalVector;
for(i=0;i<the total number of particles;i++)
{
myVector = particleNumber_i.Posistion - currentParticle.Postion;
myTotalVector += myVector;
}
?
ben
vex pop for particle flocking
6379 6 1- ben.toogood
- Member
- 16 posts
- Joined: 7月 2005
- Offline
- anakin78z
- Member
- 80 posts
- Joined: 7月 2005
- Offline
you can and you can't.
in vex sops, you can use the import() vex function to import any attribute from another point. So you could run that loop if you wanted, and do all that good stuff.
In pops, sidefx decided to dissable this function (for reasons that they don't want you to be able to plug in 2 pop networks…. but I don't care! I want to be able to grab info from other particles!!! Think of it as a poppoint expression sesi!!!!!! :evil: )
anyhoo, I'm a bit bitter about that myself, but you can build a slow and overly convoluted system which does that in sops and feeds the information back to particles.
Cheers!
in vex sops, you can use the import() vex function to import any attribute from another point. So you could run that loop if you wanted, and do all that good stuff.
In pops, sidefx decided to dissable this function (for reasons that they don't want you to be able to plug in 2 pop networks…. but I don't care! I want to be able to grab info from other particles!!! Think of it as a poppoint expression sesi!!!!!! :evil: )
anyhoo, I'm a bit bitter about that myself, but you can build a slow and overly convoluted system which does that in sops and feeds the information back to particles.
Cheers!
- ben.toogood
- Member
- 16 posts
- Joined: 7月 2005
- Offline
- T-bolt
- Member
- 1 posts
- Joined: 7月 2005
- Offline
Hi, sorry for the really big topic bump :shock:, but I'm having the same issue…
I just want to be able to get the position information of each particle for my VEX POP function. My flock has only 12 members so I'm even willing to pass the positions in through the function parameters instead of within the function, but I'm not sure how to even get the information that way. :? Any ideas?
Thanks,
Paul
I just want to be able to get the position information of each particle for my VEX POP function. My flock has only 12 members so I'm even willing to pass the positions in through the function parameters instead of within the function, but I'm not sure how to even get the information that way. :? Any ideas?
Thanks,
Paul
- edward
- Member
- 7733 posts
- Joined: 7月 2005
- Offline
anakin78z mentioned using the poppoint() expression function. (in textport: exhelp poppoint). So to use it, put poppoint(opinputpath(“.”,0), …etc…) expressions in your VEX POP parameters.
As for the second method that he mentioned, it's not too hard in H7. You create your POP Network in SOPs. Then when you want to do your VEX stuff, back up one level and append a VEX SOP instead. So just copy the contents of your VOP POP to the VOP SOP instead. This allows you to use the Import VOP to import the attribute “P” (point) given any particular point number.
Now when you want to do more particle manipulations, append another POP Network to the VEX SOP. Inside this new POP Network, create a Source POP. Set its Geometry Source parameter to First Context. Now you can continue with your regular POP work.
As for the second method that he mentioned, it's not too hard in H7. You create your POP Network in SOPs. Then when you want to do your VEX stuff, back up one level and append a VEX SOP instead. So just copy the contents of your VOP POP to the VOP SOP instead. This allows you to use the Import VOP to import the attribute “P” (point) given any particular point number.
Now when you want to do more particle manipulations, append another POP Network to the VEX SOP. Inside this new POP Network, create a Source POP. Set its Geometry Source parameter to First Context. Now you can continue with your regular POP work.
- Ondrej
- スタッフ
- 1072 posts
- Joined: 7月 2005
- Offline
I don't believe the issue in the pop context was plugging in 2 pop networks. I believe that the problem we were trying to prevent was attempting to read an attribute that is being written to. VEX gives no guarantee on execution order, so this could be a problem.
That being said, it would appear that we decided to let users shoot themselves in the foot anyway as of 6.1.70, by allowing the import, getneighbour and getneighbourcount functions in the pop context. Interestingly enough, it's possible that we neglected to mention this little fact anywhere. At least I can find no mention of this in the VEX documentation.
That being said, it would appear that we decided to let users shoot themselves in the foot anyway as of 6.1.70, by allowing the import, getneighbour and getneighbourcount functions in the pop context. Interestingly enough, it's possible that we neglected to mention this little fact anywhere. At least I can find no mention of this in the VEX documentation.
- edward
- Member
- 7733 posts
- Joined: 7月 2005
- Offline
-
- Quick Links