Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. t = ImageResize[ExampleData@#, {100, 100}] & /@
  2. ExampleData["ColorTexture"][[;; 6]];
  3.  
  4. vtc = {{0, 0}, {1, 0}, {1, 1}, {0, 1}};
  5. coords = {{{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}}, {{0, 0,
  6. 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}}, {{1, 0, 0}, {1, 1, 0}, {1,
  7. 1, 1}, {1, 0, 1}}, {{1, 1, 0}, {0, 1, 0}, {0, 1, 1}, {1, 1,
  8. 1}}, {{0, 1, 0}, {0, 0, 0}, {0, 0, 1}, {0, 1, 1}}, {{1, 0,
  9. 1}, {1, 1, 1}, {0, 1, 1}, {0, 0, 1}}};
  10.  
  11. Graphics3D[{Table[{Texture@t[[i]],
  12. Polygon[coords[[i]], VertexTextureCoordinates -> vtc]}, {i, 6}]}]
  13.  
  14. cubemap = ImageResize[#, Scaled[0.5]] &@ Import@"http://i.stack.imgur.com/hSCfz.jpg";
  15.  
  16. vtccm = {{##}, {# + 1, #2}, {# + 1, #2 + 1}, {#, #2 + 1}} & @@@ {{1,
  17. 1}, {0, 2}, {1, 2}, {2, 2}, {3, 2}, {1, 3}}/4;
  18.  
  19. α = 0.;
  20. Graphics3D[{EdgeForm[], Texture[cubemap],
  21. Polygon[coords, VertexTextureCoordinates -> vtccm]},
  22. Lighting -> {{"Ambient", White}}, Boxed -> False, ViewAngle -> 1,
  23. ViewCenter -> {1, 1, 1}/2,
  24. ViewVector -> {1, 1, 1}/2 + {Cos[α], Sin[α], 0}/8,
  25. RotationAction -> "Clip", ImageSize -> 500,
  26. ViewVertical -> {0, 0, 1}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement