Isotropix Forums

Random Function

Discuss about expressions in Clarisse

Random Function

Unread postby tom_tm » Mon Feb 04, 2019 4:07 pm

Hi,
I try to get a simple random function, but it does not work.

I tried rand(0,1) or with the time component T*rand(0,1)
What's wrong ?

Noise Functions
float rand ( [float min, float max], [float seed] )
Random number between min..max (or 0..1 if unspecified)

Greets Tom
tom_tm
 
Posts: 312
Joined: Mon Nov 18, 2013 8:20 pm
Location: Switzerland

Re: Random Function

Unread postby sam » Mon Feb 04, 2019 4:32 pm

Hi Tom,

Thanks for reporting this. Actually rand is documented in Se.Expr official documentation but there's no implementation of it. When we documented Se.Expr in Clarisse, it came along in our documentation as we used the official one to create our own.

We will need to remove the reference from the doc or extend Se.Expr to support rand (as documented in the official doc)
Sorry about the confusion, the information didn't pass here between the dev and the doc.

Alternatively you can use another noise function instead.

As a matter of fact, look at the log:
Code: Select all
Expression bound on project://scene/cylinder.translate[0] failed to compile:
  Line 1 Col 0 - Function rand has no definition
Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1883
Joined: Fri Jan 25, 2013 11:33 pm

Re: Random Function

Unread postby tom_tm » Mon Feb 04, 2019 6:07 pm

Thanks Sam,
I think random with a range would be very nice rand(0,10), so I would know the output value would be somewhere inbetween 0 and 10.
Now if I take noise(F/10,1) it's hard to predict it's output value.
Or is there another way to come close to a rand?

Greets Tom
tom_tm
 
Posts: 312
Joined: Mon Nov 18, 2013 8:20 pm
Location: Switzerland

Re: Random Function

Unread postby sam » Mon Feb 04, 2019 6:10 pm

Sam Assadian
Isotropix
CEO/Founder
User avatar
sam
 
Posts: 1883
Joined: Fri Jan 25, 2013 11:33 pm


Return to Expressions
cron