# RegionPlot3D and Texture

I'm getting a white solid instead of a solid with texture, I'm not sure what is wrong:

RegionPlot3D[M, {a, -3, 3}, {c, -3, 3}, {d, -3, 3}, PlotPoints -> 100,
PlotStyle -> Directive[Texture[ExampleData[{"Texture", "Bricks2"}]]]

Here M is the solid defined by:

M:= (a < 0 && ((c < 0 && (d < 0 || d > -2 a - c)) || (c >
0 && (d < -c || d > -2 a)))) || (a >
0 && ((c < 0 && (d < -2 a || d > -c)) || (c >
0 && (d < -2 a - c || d > 0))))
• Adding TextureCoordinateFunction -> ({#1, #2, #3} &), Lighting -> "Neutral", Mesh -> False works pretty well. I'm holding off on writing an answer though, hoping that someone can explain how texture coordinates work. The rule of thumb seems to be that {x,y,z} i.e. cartesian coordinates work. Commented Jun 13, 2014 at 19:45

M := (a <  0 && ((c < 0 && (d < 0 || d > -2 a - c)) || (c >  0 && (d < -c || d > -2 a)))) || (a > 0 && ((c < 0 && (d < -2 a || d > -c)) || (c >  0 && (d < -2 a - c || d > 0))))

RegionPlot3D[M, {a, -3, 3}, {c, -3, 3}, {d, -3, 3},
Lighting -> "Neutral", Mesh -> False, PlotPoints -> 10,
PlotStyle :> Texture[ExampleData[{"ColorTexture", "WhiteMarble"}]],
TextureCoordinateScaling -> True]

RegionPlot3D[M, {a, -3, 3}, {c, -3, 3}, {d, -3, 3},
Lighting -> "Neutral", Mesh -> False, PlotPoints -> 10,
PlotStyle :> Texture[ExampleData[{"Texture", "Bricks2"}]],
TextureCoordinateFunction -> ({#1, #2} &)]

EDIT

Sergio's ansatz didn't work because one has to add:

Lighting -> "Neutral"
Mesh -> False

Also, it is necessary to remove Directive.

• Thanks again! In the second example, why the bricks are in black and white? Is it because Texture instead of ColorTexture does not add any color or is some other option? Commented Jun 14, 2014 at 1:24
• @SergioParreiras - it's because the bricks are supplied only in b&w. In this case you have to use "Texture". With marble it's just the other way around. One has to experiment a little bit here.
– eldo
Commented Jun 14, 2014 at 13:35