POV-Ray : Newsgroups : povray.binaries.scene-files : UK Flag (Union Jack) Server Time
2 Sep 2024 18:20:11 EDT (-0400)
  UK Flag (Union Jack) (Message 1 to 7 of 7)  
From: Peter Santo
Subject: UK Flag (Union Jack)
Date: 2 Mar 2000 17:56:07
Message: <38BEF26E.50E0120C@exaweb.de>
/*
If you render this Povray Scene File you'll get a picture of the
British Flag (the Union Jack). The texture is 100% procedural,
i.e. you can render it in every resolution you like without
getting any stairs as would be the case when using image maps.
On the other hand, you could use this scene to generate an
image map to map it onto some other object.

Why did I create such a scene file? I needed a picture of a 
British Flag in very high resolution and with absolutely 
correct geometry. Additionally, I wanted to experiment 
with layered pigments.

See  http://jdawiseman.com/papers/union-jack/union-jack.html for
details on geometry and color. If you need to ensure absolutely
correct colors, make sure you know the basics of Gamma values
and set Povray's Assumed_Gamma accordingly.

The flag's proportions are 2:1 so you should use povray parameters
like "+w640 +h320 +a0.1 +j0 +r5"

March 2000, Peter Santo
san### [at] exawebde
*/

#declare UK_finish = finish {
	ambient 1.0
	diffuse 0.0
}

#declare UK_white = color rgb<1, 1, 1>;
#declare UK_red   = color rgb<0.8, 0, 0.2>;
#declare UK_blue  = color rgb<0, 0.2, 0.4>;

#declare UK_diagonal = pigment {
	gradient y
	color_map {
 		[ 0/30 color UK_blue ]
		[12/30 color UK_blue ]
 		[12/30 color UK_white]
		[15/30 color UK_white]
		[15/30 color UK_red  ]
		[17/30 color UK_red  ]
		[17/30 color UK_white]
		[18/30 color UK_white]
		[18/30 color UK_blue ]
		[30/30 color UK_blue ]
	}
	translate y * 0.5
	scale 1 / sqrt(2)
}


#declare UK_d1 = pigment {
	UK_diagonal
	rotate    z * -45
	translate <0.5, 0.5, 0>
}	

#declare UK_d2 = pigment {
	UK_diagonal
	rotate     z * (180 + 45)
}	

#declare UK_d3 = pigment {
	UK_diagonal
	rotate     z * 45
}	

#declare UK_d4 = pigment {
	UK_diagonal
	rotate    z * (180 - 45)
	translate <0.5, 0.5, 0>
}	

#declare UK_white_x = pigment {
	gradient x
	pigment_map {
		[ 0/20 UK_white]
		[ 9/20 UK_white]
		[ 9/20 UK_red]
		[11/20 UK_red]
		[11/20 UK_white]
		[20/20 UK_white]
	}
}

#declare UK_bottom = pigment {
	gradient x
	pigment_map {
		[ 0/60 UK_d3]
		[25/60 UK_d3]
		[25/60 UK_white]
		[27/60 UK_white]
		[27/60 UK_red]
		[33/60 UK_red]
		[33/60 UK_white]
		[35/60 UK_white]
		[35/60 UK_d4]
		[60/60 UK_d4]
	}
}

#declare UK_top = pigment {
	gradient x
	pigment_map {
		[ 0/60 UK_d1]
		[25/60 UK_d1]
		[25/60 UK_white]
		[27/60 UK_white]
		[27/60 UK_red]
		[33/60 UK_red]
		[33/60 UK_white]
		[35/60 UK_white]
		[35/60 UK_d2]
		[60/60 UK_d2]
	}
}


// Completely nested texture
// From Top to Bottom
#declare UK_texture = texture {
	pigment {
		gradient y
		pigment_map {
			[ 0/30 UK_bottom]
			[10/30 UK_bottom]
			[10/30 UK_white_x]
			[12/30 UK_white_x]
			[12/30 UK_red]
			[18/30 UK_red]
			[18/30 UK_white_x]
			[20/30 UK_white_x]
			[20/30 UK_top]
			[30/30 UK_top]
		}
	}
	finish { UK_finish }
}



#declare perspective_camera = camera {
	location  <0, 0, -2>
	direction 2*z
	right     1*x
	look_at   <0, 0,  0>
	translate <0.5, 0.5, 0>
}

#declare orthographic_camera = camera {
	orthographic
	location  <0, 0, -2>
	direction 2 * z
	right     1 * x
	up        1 * y
	look_at   <0, 0, 0>
	translate <0.5, 0.5, 0>
}

camera { orthographic_camera }

plane {
	z, 0
	texture { UK_texture }		
}


Post a reply to this message

From: Jerry
Subject: Procedural Stars? Was Re: UK Flag (Union Jack)
Date: 3 Mar 2000 11:39:51
Message: <jerry-CACFC0.08395103032000@news.povray.org>
In article <38BEF26E.50E0120C@exaweb.de>, Peter Santo <gwe### [at] exawebde> 
wrote:
>Why did I create such a scene file? I needed a picture of a 
>British Flag in very high resolution and with absolutely 
>correct geometry. Additionally, I wanted to experiment 
>with layered pigments.

I did the same thing, for similar reasons, with the United States flag 
and one of the Confederate flags. I couldn't figure out how to make the 
stars procedural, however. Anyone have any ideas on how to make these 
flags fully procedural?

// Persistence of Vision Ray Tracer Scene Description File
// Author: Jerry Stratton (jer### [at] acusdedu)
#include "colors.inc"
#include "textures.inc"
#declare flag_red = color rgb <.8,0,0>;
#declare flag_white = color rgb <.8,.8,.8>;
#declare flag_blue = color rgb <0,0,.8>;

#declare flag_normal = normal {
   wrinkles 2
   scale .05
   turbulence .25
}

#declare flag_dirt = texture {
   pigment {
      bozo
      turbulence .2
      color_map {
         [0.0  color Gray50 filter .5]
         [0.5  color White transmit 1]
         [1.0  color White transmit 1]
      }
   }
   scale .1
}

#declare conf_bar = texture {
   pigment {
      gradient x
      frequency 1
      color_map {
         [0.0  color flag_white]
         [0.08 color flag_white]
         [0.09 color White transmit 1]
         [1.0  color White transmit 1]
      }
   }
   finish {
      ambient .5
   }
}
#declare conf_blue = pigment {
   gradient x
   frequency 1
   color_map {
      [0.0  color flag_blue]
      [0.06 color flag_blue]
      [0.06 color White transmit 2]
      [1.0  color White transmit 2]
   }
}
#declare conf_stars = pigment {
   image_map {
      gif "constar.gif"
   }
   translate <-.5,0,0>
   scale <1,330/230,1>
   scale .1
   translate <0,-.2,0>
}
#declare conf_blue_bar = texture {
   pigment {
      average
      pigment_map {
         [1 conf_blue]
         [1 conf_stars]
      }
   }
   finish {
      ambient .5
   }
}

#declare bar_rotate = 45*sqrt(2); 

#declare confederate_texture = texture {
   pigment { color flag_red }
   normal {
      flag_normal
   }
   finish {
      ambient .4
   }
}
texture { conf_bar
   rotate <0,0,bar_rotate>
   normal { flag_normal}
}
texture { conf_bar
   rotate <0,0,-bar_rotate>
   normal { flag_normal }
}
texture { conf_blue_bar
   rotate <0,0,bar_rotate>
   normal { flag_normal }
}
texture { conf_blue_bar
   rotate <0,0,-bar_rotate>
   normal { flag_normal }
}
texture { flag_dirt }



#declare blue_box = pigment {
   boxed
   color_map {
      [0.0  color White transmit 2]
      [0.1  color White transmit 2]
      [0.2  color Blue]
      [1.0  color Blue]
   }
}
#declare white_stars = pigment {
   image_map {
      gif "fedstar.gif"
   }
   scale .3
}

#declare federal_texture = texture {
   pigment {
      gradient y
      frequency 13
      color_map {
         [0.0  color flag_red]
         [0.41 color flag_red]
         [0.42 color Black]
         [0.50 color Black]
         [0.51 color flag_white]
         [0.90 color flag_white]
         [0.91 color Black]
         [0.99 color Black]
         [1.0  color flag_red]
      }
      translate <0,-.48,0>
   }
   finish {
      ambient .4
   }
}
texture {
   pigment {
      average
      pigment_map {
         [1 blue_box]
         [1 white_stars]
      }
      scale .3
      scale <7/13,7/13,1>
      translate <-4/13*2/.75,5/13,0>*.3
   }
   finish {
      ambient .4
   }
}
texture { flag_dirt }


#declare conf_flag_pigment = texture {
   confederate_texture
   translate <.45,.25,0>
   scale 2
   scale <.825,1,1>
}


#declare fed_flag_pigment = texture {
   federal_texture
   translate <.383, .25,0>
   scale 2
   scale <.825, 1, 1>
}

//Make some flags
camera {
   perspective 
   location <0.0, 0.0, -2.5>
   look_at <0.0, 0.0, 0.0>
}
light_source {
   <0.0, 100, -100>
   rgb <1.000000, 1.000000, 1.000000>
}
background {
   rgb  < 0, 1, 1>
}

box {
   <0,0,0>,<1,1,.1>
   texture {
      fed_flag_pigment
   }
   scale <1.5,1,1>
   rotate <0,0,33>
   translate <-.5,-.5.0>
   translate <-.6,0,0>
}
box {
   <0,0,0>,<1.5,1,.1>
   texture {
      conf_flag_pigment
   }
   rotate <0,0,33>
   translate <-.5,-.5.0>
   translate <1,0,.3>
}


Post a reply to this message

From: Bob Hughes
Subject: Re: Procedural Stars? Was Re: UK Flag (Union Jack)
Date: 3 Mar 2000 12:27:39
Message: <38bff60b@news.povray.org>
I know of a procedurally done star at Mike Hough's Povray tutorial web pages:
http://members.xoom.com/POVRAY3/procedural.html
Might be more of a trick getting it onto that flag though.

Bob

"Jerry" <jer### [at] acusdedu> wrote in message
news:jerry-CACFC0.08395103032000@news.povray.org...
| In article <38BEF26E.50E0120C@exaweb.de>, Peter Santo <gwe### [at] exawebde>
| wrote:
| >Why did I create such a scene file? I needed a picture of a
| >British Flag in very high resolution and with absolutely
| >correct geometry. Additionally, I wanted to experiment
| >with layered pigments.
|
| I did the same thing, for similar reasons, with the United States flag
| and one of the Confederate flags. I couldn't figure out how to make the
| stars procedural, however. Anyone have any ideas on how to make these
| flags fully procedural?
|
| // Persistence of Vision Ray Tracer Scene Description File
| // Author: Jerry Stratton (jer### [at] acusdedu)
| #include "colors.inc"
| #include "textures.inc"
| #declare flag_red = color rgb <.8,0,0>;
| #declare flag_white = color rgb <.8,.8,.8>;
| #declare flag_blue = color rgb <0,0,.8>;
|
| #declare flag_normal = normal {
|    wrinkles 2
|    scale .05
|    turbulence .25
| }
|
| #declare flag_dirt = texture {
|    pigment {
|       bozo
|       turbulence .2
|       color_map {
|          [0.0  color Gray50 filter .5]
|          [0.5  color White transmit 1]
|          [1.0  color White transmit 1]
|       }
|    }
|    scale .1
| }
|
| #declare conf_bar = texture {
|    pigment {
|       gradient x
|       frequency 1
|       color_map {
|          [0.0  color flag_white]
|          [0.08 color flag_white]
|          [0.09 color White transmit 1]
|          [1.0  color White transmit 1]
|       }
|    }
|    finish {
|       ambient .5
|    }
| }
| #declare conf_blue = pigment {
|    gradient x
|    frequency 1
|    color_map {
|       [0.0  color flag_blue]
|       [0.06 color flag_blue]
|       [0.06 color White transmit 2]
|       [1.0  color White transmit 2]
|    }
| }
| #declare conf_stars = pigment {
|    image_map {
|       gif "constar.gif"
|    }
|    translate <-.5,0,0>
|    scale <1,330/230,1>
|    scale .1
|    translate <0,-.2,0>
| }
| #declare conf_blue_bar = texture {
|    pigment {
|       average
|       pigment_map {
|          [1 conf_blue]
|          [1 conf_stars]
|       }
|    }
|    finish {
|       ambient .5
|    }
| }
|
| #declare bar_rotate = 45*sqrt(2);
|
| #declare confederate_texture = texture {
|    pigment { color flag_red }
|    normal {
|       flag_normal
|    }
|    finish {
|       ambient .4
|    }
| }
| texture { conf_bar
|    rotate <0,0,bar_rotate>
|    normal { flag_normal}
| }
| texture { conf_bar
|    rotate <0,0,-bar_rotate>
|    normal { flag_normal }
| }
| texture { conf_blue_bar
|    rotate <0,0,bar_rotate>
|    normal { flag_normal }
| }
| texture { conf_blue_bar
|    rotate <0,0,-bar_rotate>
|    normal { flag_normal }
| }
| texture { flag_dirt }
|
|
|
| #declare blue_box = pigment {
|    boxed
|    color_map {
|       [0.0  color White transmit 2]
|       [0.1  color White transmit 2]
|       [0.2  color Blue]
|       [1.0  color Blue]
|    }
| }
| #declare white_stars = pigment {
|    image_map {
|       gif "fedstar.gif"
|    }
|    scale .3
| }
|
| #declare federal_texture = texture {
|    pigment {
|       gradient y
|       frequency 13
|       color_map {
|          [0.0  color flag_red]
|          [0.41 color flag_red]
|          [0.42 color Black]
|          [0.50 color Black]
|          [0.51 color flag_white]
|          [0.90 color flag_white]
|          [0.91 color Black]
|          [0.99 color Black]
|          [1.0  color flag_red]
|       }
|       translate <0,-.48,0>
|    }
|    finish {
|       ambient .4
|    }
| }
| texture {
|    pigment {
|       average
|       pigment_map {
|          [1 blue_box]
|          [1 white_stars]
|       }
|       scale .3
|       scale <7/13,7/13,1>
|       translate <-4/13*2/.75,5/13,0>*.3
|    }
|    finish {
|       ambient .4
|    }
| }
| texture { flag_dirt }
|
|
| #declare conf_flag_pigment = texture {
|    confederate_texture
|    translate <.45,.25,0>
|    scale 2
|    scale <.825,1,1>
| }
|
|
| #declare fed_flag_pigment = texture {
|    federal_texture
|    translate <.383, .25,0>
|    scale 2
|    scale <.825, 1, 1>
| }
|
| file://Make some flags
| camera {
|    perspective
|    location <0.0, 0.0, -2.5>
|    look_at <0.0, 0.0, 0.0>
| }
| light_source {
|    <0.0, 100, -100>
|    rgb <1.000000, 1.000000, 1.000000>
| }
| background {
|    rgb  < 0, 1, 1>
| }
|
| box {
|    <0,0,0>,<1,1,.1>
|    texture {
|       fed_flag_pigment
|    }
|    scale <1.5,1,1>
|    rotate <0,0,33>
|    translate <-.5,-.5.0>
|    translate <-.6,0,0>
| }
| box {
|    <0,0,0>,<1.5,1,.1>
|    texture {
|       conf_flag_pigment
|    }
|    rotate <0,0,33>
|    translate <-.5,-.5.0>
|    translate <1,0,.3>
| }


Post a reply to this message

From: Peter Santo
Subject: Re: Procedural Stars? Was Re: UK Flag (Union Jack)
Date: 3 Mar 2000 13:52:50
Message: <38C00AEE.8A64EB8B@cantor.informatik.rwth-aachen.de>
> I know of a procedurally done star at Mike Hough's Povray tutorial web pages:
> http://members.xoom.com/POVRAY3/procedural.html

Good link. Mike does the trick with transparency and I don't think it
can be done any other way. This seems to hold for all patterns that
contain convex and concave elements.

/PETER/


Post a reply to this message

From: Chris Huff
Subject: Re: Procedural Stars? Was Re: UK Flag (Union Jack)
Date: 3 Mar 2000 15:24:48
Message: <chrishuff_99-E3E618.15262503032000@news.povray.org>
In article <jerry-CACFC0.08395103032000@news.povray.org>, Jerry 
<jer### [at] acusdedu> wrote:

> In article <38BEF26E.50E0120C@exaweb.de>, Peter Santo <gwe### [at] exawebde> 
> wrote:
> >Why did I create such a scene file? I needed a picture of a 
> >British Flag in very high resolution and with absolutely 
> >correct geometry. Additionally, I wanted to experiment 
> >with layered pigments.
> 
> I did the same thing, for similar reasons, with the United States flag 
> and one of the Confederate flags. I couldn't figure out how to make the 
> stars procedural, however. Anyone have any ideas on how to make these 
> flags fully procedural?

If you are using MegaPOV, it could probably be done with a function 
pattern, but it would be easier to use the object pattern with a prism 
object. I think there are examples of this use of the object pattern 
included in the sample scenes...

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Colefax
Subject: Re: Procedural Stars? Was Re: UK Flag (Union Jack)
Date: 4 Mar 2000 20:30:42
Message: <38c1b8c2@news.povray.org>
Peter Santo <spa### [at] cantorinformatikrwth-aachende> wrote:
> Good link. Mike does the trick with transparency and I don't think it
> can be done any other way. This seems to hold for all patterns that
> contain convex and concave elements.

How about using a few nested pigments, e.g. (no camera or lights necessary):

#macro star_pigment (Points, PointAngle, PigmentMap)
   #local Point1 = pigment {planar
      pigment_map {PigmentMap}
      rotate z*PointAngle/2 rotate x*90}
   #local Point2 = pigment {Point1 scale <1, 1, -1>}

   radial pigment_map {
      [.5/Points Point1]
      #declare C = 1; #while (C <= Points)
         [(C-.5)/Points Point2 rotate y*360*C/Points]
         [C/Points Point2 rotate y*360*C/Points]
         [C/Points Point1 rotate y*360*C/Points]
         [(C+.5)/Points Point1 rotate y*360*C/Points]
      #declare C = C + 1; #end
      [(Points-.5)/Points Point2]
      }
      rotate <-90, 0, 90>
      scale sin(radians(PointAngle/2))
#end

#declare Blue = rgb <0, .5, 1>;
#declare White = rgb 1;

plane {z, 0
   pigment {star_pigment (5, 40,
      pigment_map {[0 Blue] [.01 White] [.2 White] [.21 Blue]}
      )}
   finish {ambient 1 diffuse 0}
   translate z*3}


Post a reply to this message

From: Peter Santo
Subject: Re: UK Flag (Union Jack)
Date: 4 Mar 2000 22:06:18
Message: <38C1D01A.CB67C5B@cantor.informatik.rwth-aachen.de>
> Very nice, any chance you know a site where flag details are given? I
> found www.flags.net which gives the aspect ratio, but not construction
> details.
> 
> Anyone?

Thank you. This looks like a RTFM (no harm intended :), in the comments
is the source I used:
http://jdawiseman.com/papers/union-jack/union-jack.html

/PETER/


Post a reply to this message

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