Commit 798be6f2 authored by Jan Möbius's avatar Jan Möbius
Browse files

Added random color generation to material node

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10120 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 2cdfeb6d
......@@ -131,6 +131,14 @@ public:
c = _c * 0.8f; c[3]=_c[3]; specularColor(c);
}
/// Creates a randomized color and sets it
void generateRandomColor() {
color( Vec4f(0.2 + double(rand())/double(RAND_MAX)*0.8,
0.2 + double(rand())/double(RAND_MAX)*0.8,
0.2 + double(rand())/double(RAND_MAX)*0.8,
1.0));
}
/// set the base color
void baseColor(const Vec4f& _c) { baseColor_ = _c;}
/// get the base color
......@@ -357,6 +365,11 @@ public:
material_.color(_c);
}
/// Generates a random color and sets it
void set_random_color() {
material_.generateRandomColor();
}
/// set the base color
void set_base_color(const Vec4f& _c) { material_.baseColor(_c); }
/// get the base color
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment