Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #6367 > unrolled thread
| Started by | Roger Bagula <roger.bagula@gmail.com> |
|---|---|
| First post | 2011-11-11 10:00 +0000 |
| Last post | 2011-11-14 12:17 +0000 |
| Articles | 4 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Problem:a texture on only one face of a Polyhedron Roger Bagula <roger.bagula@gmail.com> - 2011-11-11 10:00 +0000
Re: Problem:a texture on only one face of a Polyhedron Yves Klett <yves.klett@googlemail.com> - 2011-11-11 12:36 +0000
Re: Problem:a texture on only one face of a Polyhedron Roger Bagula <roger.bagula@gmail.com> - 2011-11-14 12:16 +0000
Re: Problem:a texture on only one face of a Polyhedron Roger Bagula <roger.bagula@gmail.com> - 2011-11-14 12:17 +0000
| From | Roger Bagula <roger.bagula@gmail.com> |
|---|---|
| Date | 2011-11-11 10:00 +0000 |
| Subject | Problem:a texture on only one face of a Polyhedron |
| Message-ID | <j9irn2$8f1$1@smc.vnet.net> |
The problem is the
VertexTextureCoordinates ->
They seem to specify only one face specifically.
I'd like to get the texture on all the faces.
Here what runs to give one textured face:
gm = ExampleData[{"ColorTexture", "WhiteMarble"}];
v = {{0, 0, -(5/Sqrt[50 - 10 Sqrt[5]])}, {0, 0, 5/Sqrt[
50 - 10 Sqrt[5]]}, {-Sqrt[(2/(5 - Sqrt[5]))],
0, -(1/Sqrt[10 - 2 Sqrt[5]])}, {Sqrt[2/(5 - Sqrt[5])], 0, 1/Sqrt[
10 - 2 Sqrt[5]]}, {(1 + Sqrt[5])/(
2 Sqrt[10 - 2 Sqrt[5]]), -(1/2), -(1/Sqrt[10 - 2 Sqrt[5]])}, {(
1 + Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]]), 1/
2, -(1/Sqrt[10 - 2 Sqrt[5]])}, {-((1 + Sqrt[5])/(
2 Sqrt[10 - 2 Sqrt[5]])), -(1/2), 1/Sqrt[
10 - 2 Sqrt[5]]}, {-((1 + Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]])), 1/2,
1/Sqrt[10 - 2 Sqrt[5]]}, {-((-1 + Sqrt[5])/(
2 Sqrt[10 - 2 Sqrt[5]])), -(1/2) Sqrt[(5 + Sqrt[5])/(
5 - Sqrt[5])], -(1/Sqrt[10 - 2 Sqrt[5]])}, {-((-1 + Sqrt[5])/(
2 Sqrt[10 - 2 Sqrt[5]])),
1/2 Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])], -(1/Sqrt[
10 - 2 Sqrt[5]])}, {(-1 + Sqrt[5])/(
2 Sqrt[10 - 2 Sqrt[5]]), -(1/2) Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])],
1/Sqrt[10 - 2 Sqrt[5]]}, {(-1 + Sqrt[5])/(
2 Sqrt[10 - 2 Sqrt[5]]), 1/2 Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])], 1/
Sqrt[10 - 2 Sqrt[5]]}};
i = {{2, 12, 8}, {2, 8, 7}, {2, 7, 11}, {2, 11, 4}, {2, 4, 12}, {5, 9,
1}, {6, 5, 1}, {10, 6, 1}, {3, 10, 1}, {9, 3, 1}, {12, 10,
8}, {8, 3, 7}, {7, 9, 11}, {11, 5, 4}, {4, 6, 12}, {5, 11, 9}, {6,
4, 5}, {10, 12, 6}, {3, 8, 10}, {9, 7, 3}};
g5 = Graphics3D[{Blue, Opacity[0.5], Specularity[White, 20],
Texture[gm],
GraphicsComplex[v, Polygon[i],
VertexTextureCoordinates -> {{1, 0}, {1/4 (-1 + Sqrt[5]), Sqrt[
5/8 + Sqrt[5]/8]}, {1/4 (-1 - Sqrt[5]), Sqrt[
5/8 - Sqrt[5]/8]}, {1/4 (-1 - Sqrt[5]), -Sqrt[
5/8 - Sqrt[5]/8]}, {1/4 (-1 + Sqrt[5]), -Sqrt[
5/8 + Sqrt[5]/8]}}]}, Boxed -> False]
[toc] | [next] | [standalone]
| From | Yves Klett <yves.klett@googlemail.com> |
|---|---|
| Date | 2011-11-11 12:36 +0000 |
| Message-ID | <j9j4s5$a8e$1@smc.vnet.net> |
| In reply to | #6367 |
Hi,
the following is straight from the documentation of Texture (Neat
Examples) with Opacity of EdgeForm set to 1, because otherwise the
textures are not actually displayed on my machine. Perhaps you can crib
some of the code.
Manipulate[
Graphics3D[{Specularity[White, 20],
Texture[ImageCrop[
ExampleData[{"ColorTexture", "WhiteMarble"}], {128, 128}]],
EdgeForm[
Opacity[1]], (Append[#1, {VertexTextureCoordinates ->
With[{n = Length[First[#1]]},
Table[1/2 {Cos[2 \[Pi] i/n], Sin[2 \[Pi] i/n]} + {1/2,
1/2}, {i, 0, n - 1}]]}] &) /@
Flatten[Normal[PolyhedronData[p, "Faces"]]]},
Lighting -> "Neutral"], {{p, "RhombicHexecontahedron",
"polyhedron"}, PolyhedronData[]}]
Regards,
Yves
Am 11.11.2011 11:00, schrieb Roger Bagula:
> The problem is the
> VertexTextureCoordinates ->
> They seem to specify only one face specifically.
> I'd like to get the texture on all the faces.
> Here what runs to give one textured face:
>
> gm = ExampleData[{"ColorTexture", "WhiteMarble"}];
> v = {{0, 0, -(5/Sqrt[50 - 10 Sqrt[5]])}, {0, 0, 5/Sqrt[
> 50 - 10 Sqrt[5]]}, {-Sqrt[(2/(5 - Sqrt[5]))],
> 0, -(1/Sqrt[10 - 2 Sqrt[5]])}, {Sqrt[2/(5 - Sqrt[5])], 0, 1/Sqrt[
> 10 - 2 Sqrt[5]]}, {(1 + Sqrt[5])/(
> 2 Sqrt[10 - 2 Sqrt[5]]), -(1/2), -(1/Sqrt[10 - 2 Sqrt[5]])}, {(
> 1 + Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]]), 1/
> 2, -(1/Sqrt[10 - 2 Sqrt[5]])}, {-((1 + Sqrt[5])/(
> 2 Sqrt[10 - 2 Sqrt[5]])), -(1/2), 1/Sqrt[
> 10 - 2 Sqrt[5]]}, {-((1 + Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]])), 1/2,
> 1/Sqrt[10 - 2 Sqrt[5]]}, {-((-1 + Sqrt[5])/(
> 2 Sqrt[10 - 2 Sqrt[5]])), -(1/2) Sqrt[(5 + Sqrt[5])/(
> 5 - Sqrt[5])], -(1/Sqrt[10 - 2 Sqrt[5]])}, {-((-1 + Sqrt[5])/(
> 2 Sqrt[10 - 2 Sqrt[5]])),
> 1/2 Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])], -(1/Sqrt[
> 10 - 2 Sqrt[5]])}, {(-1 + Sqrt[5])/(
> 2 Sqrt[10 - 2 Sqrt[5]]), -(1/2) Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])],
> 1/Sqrt[10 - 2 Sqrt[5]]}, {(-1 + Sqrt[5])/(
> 2 Sqrt[10 - 2 Sqrt[5]]), 1/2 Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])], 1/
> Sqrt[10 - 2 Sqrt[5]]}};
> i = {{2, 12, 8}, {2, 8, 7}, {2, 7, 11}, {2, 11, 4}, {2, 4, 12}, {5, 9,
> 1}, {6, 5, 1}, {10, 6, 1}, {3, 10, 1}, {9, 3, 1}, {12, 10,
> 8}, {8, 3, 7}, {7, 9, 11}, {11, 5, 4}, {4, 6, 12}, {5, 11, 9}, {6,
> 4, 5}, {10, 12, 6}, {3, 8, 10}, {9, 7, 3}};
> g5 = Graphics3D[{Blue, Opacity[0.5], Specularity[White, 20],
> Texture[gm],
> GraphicsComplex[v, Polygon[i],
> VertexTextureCoordinates -> {{1, 0}, {1/4 (-1 + Sqrt[5]), Sqrt[
> 5/8 + Sqrt[5]/8]}, {1/4 (-1 - Sqrt[5]), Sqrt[
> 5/8 - Sqrt[5]/8]}, {1/4 (-1 - Sqrt[5]), -Sqrt[
> 5/8 - Sqrt[5]/8]}, {1/4 (-1 + Sqrt[5]), -Sqrt[
> 5/8 + Sqrt[5]/8]}}]}, Boxed -> False]
>
[toc] | [prev] | [next] | [standalone]
| From | Roger Bagula <roger.bagula@gmail.com> |
|---|---|
| Date | 2011-11-14 12:16 +0000 |
| Message-ID | <j9r0rq$bkb$1@smc.vnet.net> |
| In reply to | #6392 |
On Nov 11, 4:36 am, Yves Klett <yves.kl...@googlemail.com> wrote: > Hi, > > the following is straight from the documentation of Texture (Neat > Examples) with Opacity of EdgeForm set to 1, because otherwise the > textures are not actually displayed on my machine. Perhaps you can crib > some of the code. ..... > Regards, > Yves > Yves Klett Thanks, I missed that... it works, but in only one view,( got my own texture in), but it won't export a 3d model and the picture has the manipulate box that has to trimmed or cropped. I'd already figured out the texture coordinates have to be 2d and orientated triangles. You do know that Mathematica textures are not exportable to 3ds, or obj 3d models? Texture ( real in 3d) are a harder problem. What I'm trying to do is get a specifically orientated triangle of my own texture tiled onto the Icosahedron. I'm closer now. Roger
[toc] | [prev] | [next] | [standalone]
| From | Roger Bagula <roger.bagula@gmail.com> |
|---|---|
| Date | 2011-11-14 12:17 +0000 |
| Message-ID | <j9r0sp$bkh$1@smc.vnet.net> |
| In reply to | #6392 |
I got my texture onto the icosahedron by shifting the stuff
around until it worked, LOL.
Gets my own texture on it and different views,
still no texture output to 3ds, but it is progress...
It would be really nice
if somebody documented
how these "macros" work
( at least in the help file)?
Roger Bagula
gm = ExampleData[{"ColorTexture", "WhiteMarble"}];
v = {{0, 0, -(5/Sqrt[50 - 10 Sqrt[5]])}, {0, 0,
5/Sqrt[50 - 10 Sqrt[5]]}, {-Sqrt[(2/(5 - Sqrt[5]))],
0, -(1/Sqrt[10 - 2 Sqrt[5]])}, {Sqrt[2/(5 - Sqrt[5])], 0,
1/Sqrt[10 - 2 Sqrt[5]]}, {(1 +
Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]]), -(1/2), -(1/
Sqrt[10 - 2 Sqrt[5]])}, {(1 +
Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]]),
1/2, -(1/
Sqrt[10 - 2 Sqrt[5]])}, {-((1 +
Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]])), -(1/2),
1/Sqrt[10 -
2 Sqrt[5]]}, {-((1 + Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]])), 1/2,
1/Sqrt[10 -
2 Sqrt[5]]}, {-((-1 + Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]])), -(1/
2) Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])], -(1/
Sqrt[10 - 2 Sqrt[5]])}, {-((-1 +
Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]])),
1/2 Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])], -(1/
Sqrt[10 - 2 Sqrt[5]])}, {(-1 +
Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]]), -(1/
2) Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])],
1/Sqrt[10 - 2 Sqrt[5]]}, {(-1 + Sqrt[5])/(2 Sqrt[10 - 2 Sqrt[5]]),
1/2 Sqrt[(5 + Sqrt[5])/(5 - Sqrt[5])], 1/Sqrt[10 - 2 Sqrt[5]]}};
i = {{2, 12, 8}, {2, 8, 7}, {2, 7, 11}, {2, 11, 4}, {2, 4, 12}, {5, 9,
1}, {6, 5, 1}, {10, 6, 1}, {3, 10, 1}, {9, 3, 1}, {12, 10,
8}, {8, 3, 7}, {7, 9, 11}, {11, 5, 4}, {4, 6, 12}, {5, 11, 9}, {6,
4, 5}, {10, 12, 6}, {3, 8, 10}, {9, 7, 3}};
g5 = Graphics3D[{Blue, Opacity[0.5], Specularity[White, 20],
Texture[gm],
GraphicsComplex[v,
Polygon[i]], (Append[#1, {VertexTextureCoordinates ->
With[{n = Length[First[#1]]},
Table[1/2 {Cos[2 \[Pi] i/n], Sin[2 \[Pi] i/n]} + {1/2,
1/2}, {i, 0, n - 1}]]}] &) /@
Flatten[Normal[PolyhedronData["Icosahedron", "Faces"]]]},
Boxed -> False]
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web