POV-Ray : Newsgroups : povray.binaries.images : US Flag texture (~29kbu) Server Time
19 Nov 2024 18:18:41 EST (-0500)
  US Flag texture (~29kbu) (Message 1 to 5 of 5)  
From: Redbeard
Subject: US Flag texture (~29kbu)
Date: 5 Nov 2001 00:53:09
Message: <3be62945@news.povray.org>
I'm working on a US Flag texture.  I've been able to get 48 stars using a repeat
warp and a macro Chris Colefax offered some time back for a star texture
(sorry... can't find the post).

Any ideas on how to get the 50 stars in the 5 6's, 4 5's pattern?  I've included
my repeat statement for reference.

Stars should look like:
*     *     *     *     *     *
   *     *     *     *     *
*     *     *     *     *     *
   *     *     *     *     *
*     *     *     *     *     *
   *     *     *     *     *
*     *     *     *     *     *
   *     *     *     *     *
*     *     *     *     *     *

Repeat warp currently used:
#declare OldGloryBlue = rgb <0,40,104> / 255;
#declare P_USAStars =
pigment
{
    star_pigment(5, 40, pigment_map
    {
        [0 OldGloryBlue]
        [0.00001 White]
    })

    translate <1,1,0>
    warp { repeat x * 3 }
    warp { repeat y * 2.75 }
    scale StarDia / 2
    translate 6 * Stripe * y + <0.5,0.4,0> * StarDia
}

This isn't terribly accurate, but it works.  For 48 stars.  And I need 50 :-)

BTW, there is a black border around the flag and between the stripes and around
the union.  This will be adjustable in the final pattern.

Thanks all,
Michael
--
#macro M(D,J)text{ttf"cyrvetic.ttf"D 1,0translate-J}#end#macro N(E,K)#local A=
M(E,K)light_source{-z*30rgb 1projected_through{A}}#end N("Michael"<1.6,-.2,5>)
N("Johnson"<1.9.8,5>)sphere{z*9,4pigment{gradient x+y scale 10color_map{[0 rgb
x][1rgb x+y]}sine_wave}} // (c)2001 Michael D Johnson red### [at] wvadelphianet


Post a reply to this message


Attachments:
Download 'flagtexture.jpg' (30 KB)

Preview of image 'flagtexture.jpg'
flagtexture.jpg


 

From: Josh English
Subject: Re: US Flag texture (~29kbu)
Date: 5 Nov 2001 12:36:58
Message: <3BE6CDF5.C107301B@spiritone.com>
Redbeard wrote:
> 
> I'm working on a US Flag texture.  I've been able to get 48 stars using a repeat
> warp and a macro Chris Colefax offered some time back for a star texture
> (sorry... can't find the post).
> 
> Any ideas on how to get the 50 stars in the 5 6's, 4 5's pattern?  I've included
> my repeat statement for reference.
> 
> Stars should look like:
> *     *     *     *     *     *
>    *     *     *     *     *
> *     *     *     *     *     *
>    *     *     *     *     *
> *     *     *     *     *     *
>    *     *     *     *     *
> *     *     *     *     *     *
>    *     *     *     *     *
> *     *     *     *     *     *
> 
> Repeat warp currently used:
> #declare OldGloryBlue = rgb <0,40,104> / 255;
> #declare P_USAStars =
> pigment
> {
>     star_pigment(5, 40, pigment_map
>     {
>         [0 OldGloryBlue]
>         [0.00001 White]
>     })
> 
>     translate <1,1,0>
>     warp { repeat x * 3 }
>     warp { repeat y * 2.75 }
>     scale StarDia / 2
>     translate 6 * Stripe * y + <0.5,0.4,0> * StarDia
> }
> 
> This isn't terribly accurate, but it works.  For 48 stars.  And I need 50 :-)

You want to try an offset in the second warp:
  warp { repeat y*2.75 offset <1.5,0,0> }

Note that the x offset is half the value of the first repeat warp

Josh English
eng### [at] spiritonecom


Post a reply to this message

From: Redbeard
Subject: Re: US Flag texture (~29kbu)
Date: 6 Nov 2001 09:38:40
Message: <3be7f5f0$1@news.povray.org>
"Josh English" <eng### [at] spiritonecom> wrote in message
news:3BE6CDF5.C107301B@spiritone.com...
>
> You want to try an offset in the second warp:
>   warp { repeat y*2.75 offset <1.5,0,0> }
>
> Note that the x offset is half the value of the first repeat warp
>
> Josh English
> eng### [at] spiritonecom

That helped a lot.  Now I just have to clean it up... I might go with a further
patterned texture so I can procedurally limit the number of stars on each row.
Right now on the rows with five stars I've got part of a star on either side.

I'm getting there though.  Thanks for the help.

Michael

--
#declare R=<8,4,.6>/3;#declare C=function{pattern{object{text{ttf"crystal.ttf"
"MDJ"1,0translate-R/4}}}}camera{location-z*30}box{-R,R pigment{rgbf 1}interior
{media{emission.1density{function{C(x,y,z)}density_map{[0mandel 50color_map{[0
rgb 0][.2rgb x][1rgb x+y]}interior 1,1.5scale 60translate<-33.75,2.85>exponent
4][1rgb<2,2>]}}}}scale 24hollow}// (c) 2001 MDJohnson red### [at] wvadelphianet


Post a reply to this message

From: Trevor Quayle
Subject: Re: US Flag texture (~29kbu)
Date: 6 Nov 2001 10:33:22
Message: <3be802c2$1@news.povray.org>
If you're using 3.5, perhaps using the 'object' pattern would be easier to
manipulate.

-tgq


"Redbeard" <red### [at] wvadelphianet> wrote in message
news:3be7f5f0$1@news.povray.org...
>
> "Josh English" <eng### [at] spiritonecom> wrote in message
> news:3BE6CDF5.C107301B@spiritone.com...
> >
> > You want to try an offset in the second warp:
> >   warp { repeat y*2.75 offset <1.5,0,0> }
> >
> > Note that the x offset is half the value of the first repeat warp
> >
> > Josh English
> > eng### [at] spiritonecom
>
> That helped a lot.  Now I just have to clean it up... I might go with a
further
> patterned texture so I can procedurally limit the number of stars on each
row.
> Right now on the rows with five stars I've got part of a star on either
side.
>
> I'm getting there though.  Thanks for the help.
>
> Michael
>
> --
> #declare R=<8,4,.6>/3;#declare
C=function{pattern{object{text{ttf"crystal.ttf"
> "MDJ"1,0translate-R/4}}}}camera{location-z*30}box{-R,R pigment{rgbf
1}interior
> {media{emission.1density{function{C(x,y,z)}density_map{[0mandel
50color_map{[0
> rgb 0][.2rgb x][1rgb x+y]}interior 1,1.5scale
60translate<-33.75,2.85>exponent
> 4][1rgb<2,2>]}}}}scale 24hollow}// (c) 2001 MDJohnson
red### [at] wvadelphianet
>
>


Post a reply to this message

From: Redbeard
Subject: Re: US Flag texture (~29kbu)
Date: 6 Nov 2001 22:00:14
Message: <3be8a3be$1@news.povray.org>
"Trevor Quayle" <Tin### [at] hotmailcom> wrote in message
news:3be802c2$1@news.povray.org...
> If you're using 3.5, perhaps using the 'object' pattern would be easier to
> manipulate.
>
> -tgq
>
>

Well, yes and no.  It would be easier to arrange.  But adding a potential border
between the stars and the field would be more difficult, I think.  Also, as it
stands my pattern is infinitely thick.  That is, you can slice it at any point
along the z-axis and get the same pattern.

But... object pattern with warps... hmmm...  I'll have to try that.

Thanks for the suggestion!

Michael


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.