Jump to content

noise using VEX and for loop


bhaveshpandey

Recommended Posts

I'm trying to write a VEX script which would apply noise to a geometry using a for loop..

basically what I intend to do is to Layer the noise affecting a geometry using its Point numbers as counters in the FOR loop and multiplying it with a Amplitude gain and Frequency gain parameter so that its increasing/decreasing for every iteration (which would thus give me good layer of noise applied on top of each other to a geometry.

here's my scrip so far:

float amp, freq, again, fgain, sum; 
int i;
for(i=0; i<npts; i++)
	{
		float noise;
		float AMP;
		float FREQ;
		float AMP= amp*again;
		float FREQ=freq*fgain;
		noise= AMP* noise(FREQ*P);
		sum+= noise;
	}


Sop
Sop1(amp=0.5, freq=2, again=o.5, fgain=0.5)
{
sum;
}

I have declared the variables etc..but i'm getting a syntax error in the first line..but I cant see anything wrong with it??

Also I'm not sure of how to execute it in the sop level...so just to check I just called it in the SOP level..but I'm not really sure about it....

could someone help me with this..

Thanks.

PS: here's a .vfl file

EDIT: ERR...I'm sorry I sort of started 2 new threads by mistake..Please ignore/delete this thread..my bad :blink:

noiseterrain.vfl

Edited by bhaveshpandey
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...