Jump to content

Recommended Posts

I need help I newly started with Houdini and doesn't know hot vops and vex works and I want to create a line where the normals are pointing in a different direction while keeping a 90-degree angle to the line. I fount a tutorial on the internet which only make the normals point in a random direction but not in the 90-degree angle I tried to set the normal direction to zero with floats and stuff but it always results in vex errors.

 

@N = sample_direction_uniform(rand(@ptnum));

lectro.PNG

rand nomrals.hip

efg.PNG

Share this post


Link to post
Share on other sites

Hi,

There are many ways to do this. Here is one way:

float r = radians ( 360 * rand ( @ptnum ) );
float x = sin ( r );
float z = cos ( r );

@N = set ( x, 0, z );

 

Share this post


Link to post
Share on other sites
Posted (edited)
4 hours ago, animatrix said:

Hi,

There are many ways to do this. Here is one way:


float r = radians ( 360 * rand ( @ptnum ) );
float x = sin ( r );
float z = cos ( r );

@N = set ( x, 0, z );

 

lectra.PNG.978305813a8ccdbfbb20d469ce2597b0.PNG

float r = radians ( 360 * rand ( @ptnum ) );
float x = 0;
float z = 0;

@N = set ( 0, 1, r);

Thanks but the normals aren't random at a full 360 degrees and the normal size varies I need them no be uniform because I want them to drive the velocity of a pop simulation

 

edit: sorry my line was not on the right axis (wrong up vector) it works Thanks

Edited by efour
add

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

×