Attached is a patch that is a first step towards transparency. It
adds an alpha channel to 'rgb' objects that defaults to 1.0 if it
isn't specified. It also turns on alpha blending for spheres. I
haven't started to touch the ordering issue yet. I can put two
spheres slightly overlapping and see one inside the other (the one
created is inside).
I have a question regarding style, sub-object construction and the
'rgb' class. There are two constructors there :
~~~~~~~~~~~~~~~~~~
rgb::rgb() {
r = g = b = 1.0;
a = ALPHA_DEFAULT ;
}
rgb::rgb(float _r, float _g, float _b, float _a)
: r(_r), g(_g), b(_b), a(_a)
{
}
~~~~~~~~~~~~~~~~~~
Why is sub-object construction used for one and not the other? I
think that one style should be chosed and used consistently. In this
case, just ints, it doesn't matter which one.
-D
--
A wise servant will rule over a disgraceful son,
and will share the inheritance as one of the brothers.
Proverbs 17:2
|