]> git.mxchange.org Git - simgear.git/blob - simgear/scene/util/Noise.hxx
Fix path in include directive
[simgear.git] / simgear / scene / util / Noise.hxx
1 /* -*-c++-*-
2 *
3 *  OpenSceneGraph example, osgshaders.
4 *
5 *  Permission is hereby granted, free of charge, to any person obtaining a copy
6 *  of this software and associated documentation files (the "Software"), to deal
7 *  in the Software without restriction, including without limitation the rights
8 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 *  copies of the Software, and to permit persons to whom the Software is
10 *  furnished to do so, subject to the following conditions:
11 *
12 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18 *  THE SOFTWARE.
19 */
20
21
22 /************************************************************************
23  *                                                                      *
24  *                   Copyright (C) 2002  3Dlabs Inc. Ltd.               *
25  *                                                                      *
26  ***********************************************************************/
27
28 #ifndef __ogl2_demo_h__
29 #define __ogl2_demo_h__
30
31
32 extern void SetNoiseFrequency(int frequency);
33
34 extern double noise1(double arg);
35 extern double noise2(double vec[2]);
36 extern double noise3(double vec[3]);
37 extern void normalize2(double vec[2]);
38 extern void normalize3(double vec[3]);
39
40 /*
41    In what follows "alpha" is the weight when the sum is formed.
42    Typically it is 2, As this approaches 1 the function is noisier.
43    "beta" is the harmonic scaling/spacing, typically 2.
44 */
45
46 extern double PerlinNoise1D(double x,double alpha, double beta, int n);
47 extern double PerlinNoise2D(double x,double y,double alpha, double beta, int n);
48 extern double PerlinNoise3D(double x,double y,double z,double alpha, double beta, int n);
49
50
51 #endif // __ogl2_demo_h__