two quesetions about vex
11029 11 1- flyingc
- Member
- 160 posts
- Joined:
- Offline
1.i want to wire a vex pop,how can i get a value between two values for each particle without $ID as seed?such as (-2,2) or vector{-1,-2,-1} and vector{2,1,1}
2.in 3dsmax's script ,there is a martrix3 data which is a 4*3 martix ,for example martix3 ,I can understand it as follow pictrue.but in houdini'vex ,how can i understand a 4*4 matrix ,especially the last value of each row?
2.in 3dsmax's script ,there is a martrix3 data which is a 4*3 martix ,for example martix3 ,I can understand it as follow pictrue.but in houdini'vex ,how can i understand a 4*4 matrix ,especially the last value of each row?
- chrism
- Staff
- 2494 posts
- Joined: Sept. 2007
- Offline
- flyingc
- Member
- 160 posts
- Joined:
- Offline
- edward
- Member
- 7735 posts
- Joined: July 2005
- Offline
- Simon
- Member
- 2199 posts
- Joined: July 2005
- Online
http://gpwiki.org/index.php/3D:Matrix_Math [gpwiki.org]
http://en.wikipedia.org/wiki/Transformation_matrix [en.wikipedia.org]
http://en.wikipedia.org/wiki/Transformation_matrix [en.wikipedia.org]
The trick is finding just the right hammer for every screw
- flyingc
- Member
- 160 posts
- Joined:
- Offline
thank you every one
i already have a good idea about Matrix,
but i have always been confused by the first question
in 3dsmax's Maxscript ,there is a random() function which can return diffent value for each evaluation,for example random 2. 5.,random
but in vex i can only find rand() function which only return same value between 0 and 1 for the same value for each evaluation,
how to build a similar function with random() fn in 3dsmax?
…..
sorry ,my english is not good
i already have a good idea about Matrix,
but i have always been confused by the first question
in 3dsmax's Maxscript ,there is a random() function which can return diffent value for each evaluation,for example random 2. 5.,random
but in vex i can only find rand() function which only return same value between 0 and 1 for the same value for each evaluation,
how to build a similar function with random() fn in 3dsmax?
…..
sorry ,my english is not good
- MiguelPerez
- Member
- 41 posts
- Joined: March 2006
- Offline
Well, you can create more than one Random and change the seed adding values to the ID. Then you can fit the range using the Fit Range VOP (talking about VOPs) and adjust it to be between -2 and 2. If you want to transform your points with this you can create a vector with three randoms as the components and add it to the position.
What do you exactly want to do with the random values?
What do you exactly want to do with the random values?
- flyingc
- Member
- 160 posts
- Joined:
- Offline
MiguelPerez
Well, you can create more than one Random and change the seed adding values to the ID. Then you can fit the range using the Fit Range VOP (talking about VOPs) and adjust it to be between -2 and 2. If you want to transform your points with this you can create a vector with three randoms as the components and add it to the position.
What do you exactly want to do with the random values?
the troublue is just here
for example ,i want to specify velocity for each particle use vector{rand($ID),rand($ID),rand($ID)} ,but i don't know how to get diffrent value for each component,
“Well, you can create more than one Random and change the seed adding values to the ID.” how can i get it? in pop I can only use $ID as seed
with some random vectors , I can get a group of normlized vector in arbitrary direciton so that i can more free control particle's velocity
- MichaelC
- Member
- 344 posts
- Joined: July 2005
- Offline
He means something like
vector(rand($ID+3), rand($ID+12), rand($ID+234))
You can use any expression to generate a seed for the rand function.
It doesn't matter what values you add to $ID so long as they are different for each channel. Using a scalar in combination with $ID should give you vectors that are different for every particle and every channel.
Edit: Take a look at the pop network in this file.
vector(rand($ID+3), rand($ID+12), rand($ID+234))
You can use any expression to generate a seed for the rand function.
It doesn't matter what values you add to $ID so long as they are different for each channel. Using a scalar in combination with $ID should give you vectors that are different for every particle and every channel.
Edit: Take a look at the pop network in this file.
Edited by - Dec. 2, 2007 10:01:49
- flyingc
- Member
- 160 posts
- Joined:
- Offline
- jason_iversen
- Member
- 12500 posts
- Joined: July 2005
- Online
FYI, there is also a VEX function called nrandom() which is a will return a different random number every time you call it. It might do what you expect but comes with the price, of course, that you can't rely on it to ever look the same twice.
Jason Iversen, Technology Supervisor & FX Pipeline/R+D Lead @ Weta FX
also, http://www.odforce.net [www.odforce.net]
also, http://www.odforce.net [www.odforce.net]
- flyingc
- Member
- 160 posts
- Joined:
- Offline
jason_iversenthank you
FYI, there is also a VEX function called nrandom() which is a will return a different random number every time you call it. It might do what you expect but comes with the price, of course, that you can't rely on it to ever look the same twice.
but every particle will change velocity at every frame, like in a noise force field.Is there any way can fix this problem?
-
- Quick Links