I am trying to make a PoTriangleMesh2D transparent - but it doesn't seem to be working.
I am using OIV toolkit 9.8. Is it possible to obtain transparency of the mesh in this way?
Code:
[INDENT]PoTriangleMesh2D* mesh = new PoTriangleMesh2D; mesh->setGeometry(surface.points_.size(), x, y); // add a set of scalar values to this mesh if (zmin != zmax) mesh->addValuesSet(0, z); SbColor colors[5] = {SbColor(1.0,0.0,0.0), SbColor(1.0,1.0,0.0), SbColor(0.0,1.,0.), SbColor(0.0,1.0,1.0), SbColor(0.0,0.0,1.0)}; float val[5]; val[0] = zmin; for (int j = 1; j < 5; j++) val[j] = val[j - 1] + (zmax - zmin) / 4; PoNonLinearDataMapping2* dataMapping = new PoNonLinearDataMapping2; dataMapping->value.setValues(0, 5, val); dataMapping->color.setValues(0, 5, colors); dataMapping->type = PoNonLinearDataMapping2::LINEAR_PER_LEVEL; dataMapping->transparencyEnabled = true; dataMapping->transparency = 0.2; // define the mesh surface PoMeshFilled* meshFilled = new PoMeshFilled; meshFilled->valuesIndex.setValue(0); meshFilled->coloringType = PoMesh::COLOR_MAPPING; meshFilled->zValuesIndex = 0;[/INDENT]
Comment