diff --git a/simgear/scene/tgdb/SGNodeTriangles.hxx b/simgear/scene/tgdb/SGNodeTriangles.hxx index 128b242d..799240b0 100644 --- a/simgear/scene/tgdb/SGNodeTriangles.hxx +++ b/simgear/scene/tgdb/SGNodeTriangles.hxx @@ -267,12 +267,12 @@ public: SGVec2f texCoord = a*t0 + b*t1 + c*t2; // Check this random point against the object mask - // red channel. + // blue channel. osg::Image* img = object_mask->getImage(); unsigned int x = (int) (img->s() * texCoord.x()) % img->s(); unsigned int y = (int) (img->t() * texCoord.y()) % img->t(); - if (mt_rand(&seed) < img->getColor(x, y).r()) { + if (mt_rand(&seed) < img->getColor(x, y).b()) { points.push_back(randomPoint); } } else { diff --git a/simgear/scene/tgdb/SGTexturedTriangleBin.hxx b/simgear/scene/tgdb/SGTexturedTriangleBin.hxx index b39ead0a..bdf33eec 100644 --- a/simgear/scene/tgdb/SGTexturedTriangleBin.hxx +++ b/simgear/scene/tgdb/SGTexturedTriangleBin.hxx @@ -192,12 +192,12 @@ public: SGVec2f texCoord = a*t0 + b*t1 + c*t2; // Check this random point against the object mask - // red channel. + // blue channel. osg::Image* img = object_mask->getImage(); unsigned int x = (int) (img->s() * texCoord.x()) % img->s(); unsigned int y = (int) (img->t() * texCoord.y()) % img->t(); - if (mt_rand(&seed) < img->getColor(x, y).r()) { + if (mt_rand(&seed) < img->getColor(x, y).b()) { points.push_back(randomPoint); } } else {