JohnSwafford

03 March 2006, 09:45 PM

Original Problem: The noise3, and fractalNoise functions seem to choke when given position values whose x/y/z components are not floats (i.e. integers). No error is thrown, but Point3 values that are not comprised of floats will always return the useless value of 0.0. (The noise4 function seems erratic when using integers, but it doesn't strictly return 0.0 all the time.)

Examples:

noise3 [222,333,444]

0.0

noise3 [222.2,333.3,444.4]

0.183155

fractalNoise [222,333,444] 0.5 2.0 5.0

0.0

fractalNoise [222.2,333.3,444.4] 0.5 2.0 5.0

0.420957

Bug Report (?): In order to workaround the problem, I tried to simply convert the component values to floats, but MaxScript doesn't seem to allow this if the values are whole numbers. It either won't convert them, or it automatically converts them back to integers if they are whole numbers.

Examples:

[222,333,444]*1.0

[222,333,444]

[222,333,444]*1.001

[222.222,333.333,444.444]

[(222*1.0),(333*1.0),(444*1.0)]

[222,333,444]

[(222 as float),(333 as float),(444 as float)]

[222,333,444]

Now, one of these must be a bug....either the limitations of the noise functions or this Point3 behavior. It is currently impossible to get a noise3 or fractalNoise value for any 3d position comprised of whole numbers. In fact, it seems that MaxScript won't even tolerate whole number floats in a point3 value at all.

Anyone know more about this?

I've worked around it for now, but it seems like there is something wrong here....

Examples:

noise3 [222,333,444]

0.0

noise3 [222.2,333.3,444.4]

0.183155

fractalNoise [222,333,444] 0.5 2.0 5.0

0.0

fractalNoise [222.2,333.3,444.4] 0.5 2.0 5.0

0.420957

Bug Report (?): In order to workaround the problem, I tried to simply convert the component values to floats, but MaxScript doesn't seem to allow this if the values are whole numbers. It either won't convert them, or it automatically converts them back to integers if they are whole numbers.

Examples:

[222,333,444]*1.0

[222,333,444]

[222,333,444]*1.001

[222.222,333.333,444.444]

[(222*1.0),(333*1.0),(444*1.0)]

[222,333,444]

[(222 as float),(333 as float),(444 as float)]

[222,333,444]

Now, one of these must be a bug....either the limitations of the noise functions or this Point3 behavior. It is currently impossible to get a noise3 or fractalNoise value for any 3d position comprised of whole numbers. In fact, it seems that MaxScript won't even tolerate whole number floats in a point3 value at all.

Anyone know more about this?

I've worked around it for now, but it seems like there is something wrong here....