POV-Ray : Newsgroups : povray.newusers : Olympic Flag Server Time
28 Jul 2024 18:22:54 EDT (-0400)
  Olympic Flag (Message 7 to 16 of 16)  
<<< Previous 6 Messages Goto Initial 10 Messages
From: Kenneth
Subject: Re: Olympic Flag
Date: 9 Feb 2009 03:35:01
Message: <web.498fe79fa703dd1f50167bc0@news.povray.org>
"sam kim" <nomail@nomail> wrote:

> I am trying to render an olympic flag by csg
> with torus and an object that can be used for flag.
>
> Which object should I use for flag, or should I throw away the csg
> idea out the window and approach it differently?

Recently, I made a waving flag for animating. It takes a different approach,
using a procedural height_field for the flag itself, then applying an
appropriate image_map to it. (In your case, you could render an image of your
finished flag graphic, then apply it.) The ripples in the flag come from
several bozo patterns, and 'fade in' from left to right (since one side of a
flag is attached to its flag pole, and doesn't wave there.) This is probably
more complex than what you asked for, but it produces a nice result. The code
contains some clock values for animating; just ignore those for rendering a
still image.

Typical flags have a width-to-height ratio of approximately 1.586:1, so I've
used that in the code. There *are* some problems when using pigments to
generate procedural height_fields, but I've left out most of those ugly
details, so that you won't get confused.

Ken W.
--------
#declare flag_function = // to make the undulating flag surface
function{
 pigment{ // a function evaluates its pigment on the X/Y plane.
   gradient x
   pigment_map{
   [0.0 color rgb .5] // .5 is a sort of 'bias' value here, forcing the flag to
                      // line up straight with X
   [0.85
    average
    pigment_map{
         [0.2
         bozo
         scale <595/944,1,1>
         scale 1.1*<.15,.5,1>
         color_map{
             [0.0 rgb 0]
             [1.0 rgb 1]
                  }
         translate 5.5*clock*x // for animating the pattern across the HF
         ]
         [1.0
         bozo
         scale <595/944,1,1>
         scale 1.1*<.35,.4,1>
         color_map{
            [0.0 rgb 0]
            [1.0 rgb 1]
                  }
         translate 2*y // just so it isn't the 'same' bozo pattern repeating.

         translate 5.5*clock*<1,1,0> // for animating the pattern across the
// HF. Because a function imposes a weird 'mirror image' of the pigment
// pattern it is made from, this direction vector--meant to be 45-deg.
// DOWNWARD--is instead made 45-deg. UPWARD.
         ]
        }
     ]
       }
   }
  }

height_field{
 function 944,595{ // actual pixel dimensions of my own image_map...ratio of
                   // 1.586 to 1
         flag_function(x,y,z).gray
                 }
      smooth
      double_illuminate

 texture{
   pigment{
   image_map{jpeg "my_flag_image.jpg" interpolate 2 once} // the once keyword
// is to keep extraneous pixels from showing up at the edges of flag.
   rotate -90*x
   scale <1,1,-1> // to reverse the image_map, due to
                  // HF function weirdness.
   }
  finish{
   ambient .3
   diffuse .8
        }

  normal{ // cloth weave
   average
   normal_map{
   [1.0 gradient x triangle_wave bump_size 1.2 scale .008]
   [1.0 gradient z triangle_wave bump_size 1.2 scale .016]
    }
   }
  }
 scale <944/595,1,1>
 rotate -90*x
 translate 5*y
 }


Post a reply to this message

From: Chris B
Subject: Re: Olympic Flag
Date: 9 Feb 2009 05:56:34
Message: <49900be2@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote in message 
news:web.498fe79fa703dd1f50167bc0@news.povray.org...

> Recently, I made a waving flag for animating. It takes a different 
> approach,
> using a procedural height_field for the flag itself ...

Nice!

Prompted by Sam's question I've started building a few procedural flag 
textures that I plan to upload onto the POV-Ray Object Collection. Would you 
be ok with me incorporating an adaptation of your height_field flag code for 
that, distributed under a CC-LGPL license (authorising free reuse, 
modification and redistribution)?

Regards,
Chris B.


Post a reply to this message

From: sam kim
Subject: Re: Olympic Flag
Date: 9 Feb 2009 20:30:01
Message: <web.4990d776a703dd17c859cee0@news.povray.org>
Inside and outside I see..

Thank you for an alternative to Chris's method.

I am a "TA" for this introductory course on art and science.

The professor for this course wants to use Pov-Ray as a tool for

visualizing any scientic idea.

I learned the very basics of Povray here and there.

(The most extensive work I did was to create a flexible code

to generate a boron-nitride nanotube given any chiral vector.

http://deepspace9.sci.ccny.cuny.edu/JSR/artEntry.php?passVar=kim_01
)

I am teaching high school students (since the current professor

does not want to teach herself pov-ray because of her busy schedule)

based on my very limited knowledge.

I would like to explore the alternative method for creating flags, but

I want to venture out into different projects that involves CSG.

I told the students to use CSG to first model a castle or a tower,

showing them Gilles Trans' inspiring image, The Chess Game,

http://www.oyonale.com/image.php?code=204.

If I make substantial progress on this project, (I must do it to

set an example) I'll come back to this topic.

Thank You, Sam


Post a reply to this message

From: Chris B
Subject: Re: Olympic Flag
Date: 10 Feb 2009 10:46:54
Message: <4991a16e$1@news.povray.org>
"sam kim" <nomail@nomail> wrote in message 
news:web.4990d776a703dd17c859cee0@news.povray.org...
>
> I am teaching high school students ....
> I told the students to use CSG to first model a castle or a tower,
> showing them Gilles Trans' inspiring image, The Chess Game,
> http://www.oyonale.com/image.php?code=204.
>

Sounds quite ambitious for a first project, but I guess it's always good to 
aim high.

You might be interested in the wall generation macro at 
http://lib.povray.org/collection/blockwall/chrisb%201.1.1/blockwall.html in 
this context. It draws each individual block, so you probably wouldn't want 
to use it over very large areas or it might get a bit slow, but it may be 
handy for punctuating the scene with specific features. There's a predefined 
example with a tower containing a spiral staircase in with the source.

Regards,
Chris B.


Post a reply to this message

From: sam kim
Subject: Re: Olympic Flag
Date: 10 Feb 2009 12:15:00
Message: <web.4991b56ea703dd1dfb3550c0@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
>
> Sounds quite ambitious for a first project, but I guess it's always good to
> aim high.
>

Is it?

I can't really tell how difficult it would be for beginners

to come up with a castle..

I was thinking if we work a step at a time.

It might just be possible within 2 months.

If this is too ambitious (uncertainty of achieving it is too high)

then what would be a good project topic?

Thank you for the link by the way.

Best Regards, Sam


Post a reply to this message

From: Chris B
Subject: Re: Olympic Flag
Date: 10 Feb 2009 13:03:41
Message: <4991c17d@news.povray.org>
"sam kim" <nomail@nomail> wrote in message 
news:web.4991b56ea703dd1dfb3550c0@news.povray.org...
> "Chris B" <nom### [at] nomailcom> wrote:
>>
>> Sounds quite ambitious for a first project, but I guess it's always good 
>> to
>> aim high.
>>
>
> Is it?
> I can't really tell how difficult it would be for beginners
> to come up with a castle..
> I was thinking if we work a step at a time.
> It might just be possible within 2 months.
> If this is too ambitious (uncertainty of achieving it is too high)
>
> then what would be a good project topic?
>

Actually, if it's a 2 month project and there's discussion and collaboration 
between groups of students then it might be fine. I'd imagined a first 
project of just a few days. It does depend on how much time they're spending 
on it each week too. If it's just a couple of hours a week it could be quite 
tough for them to put it down and pick it up again in that way.

Also, you should expect people to pick it up at very different rates. People 
with some sort of previous programming experience who are able to 
conceptualize 3D spaces in their heads tend to love it, but if someone lacks 
one or both of those skills/aptitudes then they could find it pretty tough 
going.

If the first bit of the project is a simple CSG gate house that's made by 
differencing boxes, or just the crenellation of the main walls, then you 
should be able to tell who can get their heads round CSG concepts. It may be 
worth sidelining different groups based on how well they cope in the first 
week or so. People who can't get their heads around CSG may be very good at 
defining textures or doing landscapes or modelling using a 3D modelling tool 
etc.

I would imaging you could collectively achieve something impressive in 2 
months.

Regards,
Chris B.


Post a reply to this message

From: clipka
Subject: Re: Olympic Flag
Date: 10 Feb 2009 17:35:01
Message: <web.499200c8a703dd1797ec15b0@news.povray.org>
"sam kim" <nomail@nomail> wrote:
> I can't really tell how difficult it would be for beginners

If you're aiming at Gilles Tran quality, it definitely is ;)

If you'd be happy enough with something barely recognizable as a cheap imitation
of some castle-like thing, you can get it in a couple of minutes :P

Maybe the best thing to do is just aim rather high, see how far you get
yourself, and use that as an estimate what quality to expect from your
students. Most people here will probably be biased, because they've been
working with POV-Ray for ages and ages.


Post a reply to this message

From: Kenneth
Subject: Re: Olympic Flag
Date: 12 Feb 2009 05:05:01
Message: <web.4993f3b9a703dd1f50167bc0@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "Kenneth" <kdw### [at] earthlinknet> wrote in message
> news:web.498fe79fa703dd1f50167bc0@news.povray.org...
>
> > Recently, I made a waving flag for animating. It takes a different
> > approach,
> > using a procedural height_field for the flag itself ...
>
> Nice!
>
> Prompted by Sam's question I've started building a few procedural flag
> textures that I plan to upload onto the POV-Ray Object Collection. Would you
> be ok with me incorporating an adaptation of your height_field flag code for
> that, distributed under a CC-LGPL license (authorising free reuse,
> modification and redistribution)?
>

Yes, feel free to do so! Thanks for asking. (Sorry for the delay in my
response--real life took over.) I may yet post the animation I came up with--my
first with POV-Ray! A whole new world has opened up; now I'll *never* get away
from the computer. :-0

Ken W.


Post a reply to this message

From: Chris B
Subject: Re: Olympic Flag
Date: 12 Feb 2009 13:01:45
Message: <49946409$1@news.povray.org>
"Kenneth" <kdw### [at] earthlinknet> wrote in message 
news:web.4993f3b9a703dd1f50167bc0@news.povray.org...
> Yes, feel free to do so!

Great, thanks. I've just uploaded it here: 
http://lib.povray.org/searchcollection/index2.php?objectName=Flags&version=1.0&contributorTag=chrisb

I hacked it around a fair bit and added a few control options (like wind 
strength and flag dimensions). It's invoked through the Flags macro when the 
"height_field" flag type is used, e.g. Flags("France","height_field").

I had a few problems with the normal_map creating striations (maybe 
something to do with me using a range of different flag sizes), so I 
commented the triangle_wave normals out for now.

Regards,
Chris B.


Post a reply to this message

From: Kenneth
Subject: Re: Olympic Flag
Date: 13 Feb 2009 06:50:00
Message: <web.49955db1a703dd1f50167bc0@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> "Kenneth" <kdw### [at] earthlinknet> wrote in message
> news:web.4993f3b9a703dd1f50167bc0@news.povray.org...
> > Yes, feel free to do so!
>
> Great, thanks. I've just uploaded it here:
>
http://lib.povray.org/searchcollection/index2.php?objectName=Flags&version=1.0&contributorTag=chrisb
>

Nice job!  Especially in turning it into a macro (something I only occasionally
dabble with; I'm impressed with your macro skills.) Some nice flag images, too.
Should be very useful.

KW


Post a reply to this message

<<< Previous 6 Messages Goto Initial 10 Messages

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