Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Texture on Disk in Mathematica 8?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123122] Re: Texture on Disk in Mathematica 8?
  • From: Heike Gramberg <heike.gramberg at gmail.com>
  • Date: Thu, 24 Nov 2011 06:54:44 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201111231204.HAA14855@smc.vnet.net>

Applying Texture to a disk directly isn't possible, but you could for example use RegionPlot with the TextureCoordinateFunction option, e.g.

img = <<Texture image>>

RegionPlot[x^2 + y^2 < 1, {x, -1, 1}, {y, -1, 1},
 BoundaryStyle -> None,
 Axes -> False, Frame -> False,
 PlotStyle -> Directive[Opacity[1], Texture[img]],
 TextureCoordinateFunction -> ({#1, #2} &)]

Heike.

On 23 Nov 2011, at 13:04, michael at socratica.com wrote:

> Is it possible to apply a texture to a disk?
>
> Applying a texture to a polygon works fine:
> Graphics[{Texture[<<Texture Image>>],
>  Polygon[{{0, 0}, {1, 0}, {1/2, 1}},
>   VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1/2, 1}}]}]
>
> But when I try to apply it to a disk I get a solid, black circle:
>  Graphics[{Texture[<<Texture Image>>], Disk[{0, 0}, 1]}]
>
> Thanks!
> -Michael
>




  • Prev by Date: Re: Sorting strings
  • Next by Date: Contour lines in middle of contour sectors
  • Previous by thread: Texture on Disk in Mathematica 8?
  • Next by thread: Re: Texture on Disk in Mathematica 8?