This feature is already available in bin/manta:
-bgcolor <color spec>
E.g.:
bin/manta -bgcolor RGBfloat .6 .6 .6
-bgcolor can be placed after the scene load to override whatever the scene default is.
On May 5, 2008, at 8:09 PM, roni@sci.utah.edu wrote:
Author: roni
Date: Mon May 5 21:09:14 2008
New Revision: 2249
Modified:
trunk/scenes/primtest.cc
Log:
M scenes/primtest.cc:
Added option for constant background ("-constantbg").
Modified: trunk/scenes/primtest.cc
==============================================================================
--- trunk/scenes/primtest.cc (original)
+++ trunk/scenes/primtest.cc Mon May 5 21:09:14 2008
@@ -87,6 +87,7 @@
bool set_primtype = false;
bool bgpoly = true;
bool bgpoly_first = false;
+ bool constant_background = false;
for(size_t i=0;i<args.size();i++){
string arg = args[i];
if(arg == "-scale"){
@@ -117,6 +118,9 @@
bgpoly = false;
} else if(arg == "-bgpolyfirst"){
bgpoly_first = true;
+ }
+ else if(arg == "-constantbg"){
+ constant_background = true;
} else {
if(arg[0] == '-' || set_primtype) {
cerr << "Valid options for scene primtest:\n";
@@ -620,9 +624,15 @@
#endif
}
Scene* scene = new Scene();
- scene->setBackground(new LinearBackground(Color(RGB(0.2, 0.4, 0.9)),
- Color(RGB(0.0,0.0,0.0)),
- Vector(0,1,0)));
+ if(constant_background){
+ scene->setBackground(new ConstantBackground(Color(RGB(0.6, 0.6, 0.6))));
+ }
+ else{
+ scene->setBackground(new LinearBackground(Color(RGB(0.2, 0.4, 0.9)),
+ Color(RGB(0.0,0.0,0.0)),
+ Vector(0,1,0)));
+ }
+
scene->setObject(group);
LightSet* lights = new LightSet();
Archive powered by MHonArc 2.6.16.