The body's opacity, 0 (invisible) to 1 (opaque, the default): below 1 it is drawn translucent (see the module documentation). Set below 1 before a window first shows it to make it translucent; then the opacity can change at any time (a translucent body stays translucent, an opaque one opaque).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Sphere), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | opacity |
0 to 1 |
subroutine set_opacity(self, opacity) class(Sphere), intent(inout) :: self real(wp), intent(in) :: opacity !! 0 to 1 self%opacity_ = max(0.0_wp, min(1.0_wp, opacity)) call apply_material(self) end subroutine set_opacity