Using rgl
:
x <- y <- z <- seq(-1, 1, by=0.01)
df <- setNames(expand.grid(x, y, z), c("x", "y", "z"))
df <- transform( df, ueq = (x^2 + y^2 + z^2 < 1) & (x^2 + y^2 < z^2))
df$color <- ifelse(df$ueq == TRUE, "green" , "red")
require(rgl)
with(df[df$ueq == TRUE, ], plot3d(x=x, y=y, z=z, col=color, type="p", size=5))
grid3d(c("x", "y+", "z"))