CloudyDay
Main Page
Classes
Files
File List
All
Classes
Functions
Variables
Enumerations
WangCloud
PerlinNoiseCloud.h
1
#pragma once
2
#include "Cloud2D.h"
3
#include <osg/Geometry>
4
#include <osg/Geode>
5
#include <osg/Texture2D>
6
#include <osg/Image>
7
#include <osgUtil/SmoothingVisitor>
8
#include <osgUtil/TangentSpaceGenerator>
9
#include <osg/BlendFunc>
10
#include <osgDB/ReadFile>
11
12
#include <cstdlib>
13
#include <iostream>
14
#include <math.h>
15
#include <stdio.h>
16
17
//Umsetzung von:
18
//Wolken (Geometry, Idee): http://freespace.virgin.net/hugo.elias/models/m_clouds.htm
19
//Perlin Noise: http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
20
//NormalMap: http://code.google.com/p/gimp-normalmap/source/browse/trunk/normalmap.c
21
//+ Parallax Mapping
22
23
namespace
osgCloudyDay
24
{
29
class
PerlinNoiseCloud
:
public
osgCloudyDay::Cloud2D
30
{
31
public
:
35
PerlinNoiseCloud
(
void
);
39
~PerlinNoiseCloud
(
void
);
40
44
void
Initialize
();
45
54
virtual
void
SetupGeometry
(osg::Vec3 position, osg::Vec2 size, osg::Vec3Array* vertices, osg::Vec2Array* tcoords, osg::UIntArray* indices);
55
56
protected
:
64
void
CreatePerlinTexture2D
(
int
width,
int
height, osg::Image* color, osg::Image* normal);
65
70
void
SetNoise
(
float
*map);
71
78
float
Noise
(
int
x,
int
y);
85
float
SmoothedNoise
(
float
x,
float
y);
93
float
Cosine_Interpolate
(
float
a,
float
b,
float
x);
100
float
InterpolatedNoise
(
float
x,
float
y);
107
float
PerlinNoise
(
float
x,
float
y);
108
};
109
}
Generated on Thu Oct 2 2014 18:53:51 for CloudyDay by
1.8.1.1