Message Boards Message Boards

GROUPS:

How to use VertexTextureCoordinates?

Posted 2 months ago
419 Views
|
2 Replies
|
0 Total Likes
|

Thank you for your help. How should I understand VertexTextureCoordinates?

pic = ExampleData[{"TestImage", "House"}];

enter image description here

V = {{0, Sqrt[3]/2, 1/2}, {0, Sqrt[3]/2, -(1/2)}, {0, 0, -1},
   {0, -(Sqrt[3]/2), -(1/2)}, {0, -(Sqrt[3]/2), 1/2}, {0, 0, 1}};
Graphics3D[{Texture[pic], EdgeForm[Red], 
  Polygon[V, 
   VertexTextureCoordinates -> {{0, 0, 0}, {1, 0, 0}, {1, 1, 0}, {0, 
      1, 1}, {0, 0, 1}, {1, 1, 1}}]}, Lighting -> "Neutral", 
 ViewPoint -> {8, 6, 4}, Axes -> True]

enter image description here

Attachments:
2 Replies

Mariano,

I guess you basically have to rescale the (2D texture) vertex coordinates:

Graphics3D[{Texture[pic], Polygon[v, VertexTextureCoordinates -> Rescale[Rest /@ v]]}, 
 Boxed -> True, Axes -> True]

enter image description here

... well, at least I hope this is you have in mind.

Muchos saludos a Lima -- Henrik

Hi Henrik,

It's exactly what I wanted.

For use in a polygon with n sides.

Thanks for your help.

Saludos para Ti tambiƩn.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract