POV-Ray : Newsgroups : povray.newusers : Olympic Flag : Re: Olympic Flag Server Time
28 Jul 2024 14:33:48 EDT (-0400)
  Re: Olympic Flag  
From: Chris B
Date: 7 Feb 2009 15:46:19
Message: <498df31b$1@news.povray.org>
"sam kim" <nomail@nomail> wrote in message 
news:web.498de26469c1735e7c859cee0@news.povray.org...
> Hello,
>
> I am trying to render an olympic flag by csg
> with torus and an object that can be used for flag.
> An example would be:
>
> http://www.scotsindependent.org/2005/050826/olympic_flag.jpg
>
> Which object should I use for flag, or should I throw away the csg
> idea out the window and approach it differently?
>

It depends how flag like you want to make it.

You can do a simplified (flat) version of this quite easily with CSG by 
positioning 5 torii of the appropriate colours, using a very thin box shape 
to cut a thin slice out of each and then a very slightly thinner white box 
to create the background flag (see the example below). It uses slightly 
different cutting surface thicknesses to avoid the surfaces of two 
overlapping circles being exactly coincident, in which case it wouldn't know 
which colour to choose.

If you need to get the circles to intersect correctly you'll need to slice 
it up a bit more.
You can add a normal clause to get it looking a bit wrinkly, but that won't 
look very convincing.

To get a proper wavy shape you can use these objects to define different 
layers of pigment that can be applied to a wavy mesh or mesh2 object in the 
shape of an authentic looking flag. This is a bit complicated for beginners, 
but would give you something you can subsequently animate if you need to.

Regards,
Chris B.

camera {location <4.5,2.5,-8> look_at <4.5,2.5,0>}
light_source {<-10,20,-25>, rgb 1}

intersection {
  torus {0.97,0.08 rotate -x*90 translate <2,3,0>}
  box {-0.000001*z,<9,5,0.010001>}
  pigment {rgb <0,0,0.2>} // Blue
}
intersection {
  torus {0.97,0.08 rotate -x*90 translate <4.5,3,0>}
  box {-0.000002*z,<9,5,0.010002>}
  pigment {rgb <0,0,0>} // Black
}
intersection {
  torus {0.97,0.08 rotate -x*90 translate <7,3,0>}
  box {-0.000003*z,<9,5,0.010003>}
  pigment {rgb <1,0,0>} // Red
}
intersection {
  torus {0.97,0.08 rotate -x*90 translate <3.25,2,0>}
  box {-0.000004*z,<9,5,0.010004>}
  pigment {rgb <0.8,0.68,0>} // Yellow
}
intersection {
  torus {0.97,0.08 rotate -x*90 translate <5.75,2,0>}
  box {-0.000005*z,<9,5,0.010005>}
  pigment {rgb <0,0.2,0>} // Green
}
box {0,<9,5,0.01>
  pigment {rgb 1}
}


Post a reply to this message

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