Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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))))
share|improve this question
1  
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. –  Pickett Jun 13 at 19:45

1 Answer 1

up vote 4 down vote accepted
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]

enter image description here

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} &)]

enter image description here

EDIT

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

Lighting -> "Neutral"
Mesh -> False

Also, it is necessary to remove Directive.

share|improve this answer
    
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? –  Sergio Parreiras Jun 14 at 1:24
1  
@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 Jun 14 at 13:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.