Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a non-technical person in the imageProcessing side,so I don't have any idea how can I make polygon in the below shape...

enter image description here

the above polygon is a 3D Graphics ,if I click on any face of the polygon it will show some message. I am still working on it,but i didn't get which function is better out of this Cuboid and Polygon

can you give any suggestions on this?

share|improve this question
You can't cut holes in a Cuboid[], so your best bet is using Polygons. It's not going to be easy, but it isn't all that difficult either — just some tedious geometry. You'll have to, of course, figure out the 3D points for the different faces and the roofs and then you can use Texture[] to tile the roof. However, I would strongly suggest against using Mathematica for this. It might be far simpler to create this in something like AutoCAD or even Google Sketchup Pro and then import it into Mathematica. – R. M. Oct 16 '12 at 5:37
@rm-rf Thanks for your information.... – subbu Oct 16 '12 at 7:12
If this was created in 3DS Max - this suggests it might be - then suitable follow-up questions could include "How can I import 3DS files that retain surface textures?" or "How can I edit 3DS files in Mathematica?". – cormullion Oct 17 '12 at 8:25
up vote 6 down vote accepted

This is a basic code to get textures and "click on any face to show message" features:


  {Texture[ExampleData[{"ColorTexture", "Metal4"}]],
    Polygon[{{-1, -1, 0}, {1, -1, 0}, {1, 1, 0}, {-1, 1, 0}}, 
     VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}],
    Style["metallic floor", 18]]},

  {Texture[ExampleData[{"ColorTexture", "Roof"}]], EdgeForm[],
    Polygon[{{0, 0, 0}, {1, 0, 0}, {1, 1, 1}, {0, 1, 1}}, 
     VertexTextureCoordinates -> {{0, 0, 0}, {1, 0, 0}, {1, 1, 1}, {0,
         1, 1}}],
    Style["brick roof", 18]] }

  }, Lighting -> "Neutral"]

enter image description here

Now for sophisticated designs look at demonstrations:

enter image description here

share|improve this answer

Your Answer


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.