two quesetions about vex

   11029   11   1
User Avatar
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?

Attachments:
Snap1.jpg (60.4 KB)

User Avatar
Staff
2494 posts
Joined: Sept. 2007
Offline
I usually think of the 4th dimension as time and it all makes sense to me that way. Don't know how you'd do a 2D/3D image of that.
The 5th dimension is….Fresca!
Chris McSpurren
Senior Quality Assurance Specialist
SideFX
User Avatar
Member
160 posts
Joined:
Offline
…Fresca,what is it means?

i want to use 4*4 matrix to build a coordsys(or space) so that i can set velocity in that space
User Avatar
Member
7735 posts
Joined: July 2005
Offline
You can simply treat the missing row/column as .
User Avatar
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]
The trick is finding just the right hammer for every screw
User Avatar
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
User Avatar
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?
User Avatar
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
User Avatar
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.
Edited by - Dec. 2, 2007 10:01:49

Attachments:
randomvelocities.hipnc (65.4 KB)

User Avatar
Member
160 posts
Joined:
Offline
thank MiguelPerez and MichaelC,i succeed

Attachments:
randomvel.hipnc (61.1 KB)
Snap1.jpg (137.5 KB)

User Avatar
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]
User Avatar
Member
160 posts
Joined:
Offline
jason_iversen
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.
thank you
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