Jump to content

Float Parameter Problem !


Recommended Posts

thanks my friends :)

so how can I fix it ?

for example i want create a counter attribute.

I created a attribute for particles by name "count"

I add a custom parameter by name "Steps" and set it to 0.1 (but in natural it's equal to 0.100000001)

I write below expression for attribute's value :

{

if($FF < 10 )

{

a = $COUNT + ch("steps") ;

return a;

}

else

{

if ($COUNT > 0 )

{

a = $COUNT - ch("steps") ;

return $COUNT ;

}

}

}

but I have problem here !

when $COUNT = 0.1 then in the next step $COUNT = 1.49012e-008 and in the next step $COUNT = -0.1 and in the next step it equal to 0 ?

if I replace number 0.1 instead ch("steps") in the expression , every things are OK ,why ?!

I attach my sample Project , select attribute_Counter in the popnet1 and open Spreadsheet and check count value !

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...