Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern/noise.c')
-rw-r--r--source/blender/blenlib/intern/noise.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/noise.c b/source/blender/blenlib/intern/noise.c
index 9bc666dc971..9efe8dc9739 100644
--- a/source/blender/blenlib/intern/noise.c
+++ b/source/blender/blenlib/intern/noise.c
@@ -263,13 +263,21 @@ static float newPerlinU(float x, float y, float z)
static float orgBlenderNoise(float x, float y, float z)
{
register float cn1, cn2, cn3, cn4, cn5, cn6, i, *h;
- float ox, oy, oz, jx, jy, jz;
+ float fx, fy, fz, ox, oy, oz, jx, jy, jz;
float n= 0.5;
int ix, iy, iz, b00, b01, b10, b11, b20, b21;
- ox= (x- (ix= (int)floor(x)) );
- oy= (y- (iy= (int)floor(y)) );
- oz= (z- (iz= (int)floor(z)) );
+ fx= floor(x);
+ fy= floor(y);
+ fz= floor(z);
+
+ ox= x- fx;
+ oy= y- fy;
+ oz= z- fz;
+
+ ix= (int)fx;
+ iy= (int)fy;
+ iz= (int)fz;
jx= ox-1;
jy= oy-1;