POV-Ray : Newsgroups : povray.binaries.animations : Bicubic patch artifact [GIF animation, 20 frames, 400 x 300, 205 KB] Server Time
1 Nov 2024 07:28:14 EDT (-0400)
  Bicubic patch artifact [GIF animation, 20 frames, 400 x 300, 205 KB] (Message 1 to 4 of 4)  
From: Yadgar
Subject: Bicubic patch artifact [GIF animation, 20 frames, 400 x 300, 205 KB]
Date: 24 Oct 2004 12:08:35
Message: <417bd383@news.povray.org>
High!

Today I tried an animation of a waving flag... I composed the flag of 
five bicubic patches in one row, with 40 control points altogether, the 
adjacent edges exactly matched.

But in spite of this, the boundaries of the patches come out clearly in 
most frames of the animation! Is there a way to fix this and still keep 
the bicubic patches - or should I re-program it with an isosurface?

See you in Khyberspace - 
http://home.arcor.de/yadgar/khyberspace/index-e.html
Afghanistan Chronicle: http://home.arcor.de/yadgar/
Home-made electronic music: http://home.arcor.de/yadgar/music/

Yadgar

Now playing: Starship Trooper, live 1996 (Yes)


Post a reply to this message


Attachments:
Download 'afghanflag.gif' (205 KB)

Preview of image 'afghanflag.gif'
afghanflag.gif


 

From: andrel
Subject: Re: Bicubic patch artifact [GIF animation, 20 frames, 400 x 300, 205KB]
Date: 24 Oct 2004 14:48:00
Message: <417BF85A.8090802@hotmail.com>
Yadgar wrote:

> High!
> 
> Today I tried an animation of a waving flag... I composed the flag of 
> five bicubic patches in one row, with 40 control points altogether, the 
> adjacent edges exactly matched.

You probably mean 48 control points, for every bicubic patch the two
inner lines plus the 8 control points on the ends of the flag.
I also assume you compute the remaining control points by interpolation.
In that case, it should not happen (but you knew that already).

Can you state more specifics? Which version of POV and possibly show
some source?

> But in spite of this, the boundaries of the patches come out clearly in 
> most frames of the animation! Is there a way to fix this and still keep 
> the bicubic patches - or should I re-program it with an isosurface?
I am not really familiar with isosurfaces, but I think it would be
slower and you get a 3D object.

> See you in Khyberspace - 
> http://home.arcor.de/yadgar/khyberspace/index-e.html
> Afghanistan Chronicle: http://home.arcor.de/yadgar/
> Home-made electronic music: http://home.arcor.de/yadgar/music/
> 
> Yadgar
> 
> Now playing: Starship Trooper, live 1996 (Yes)
Good idea, now playin Roundabout (Keys to ascension, Yes),
Starship Trooper coming up in a minute.


Post a reply to this message

From: Yadgar
Subject: Re: Bicubic patch artifact [GIF animation, 20 frames, 400 x 300,205KB]
Date: 25 Oct 2004 08:50:55
Message: <417cf6af@news.povray.org>
High!

andrel wrote:

> You probably mean 48 control points, for every bicubic patch the two
> inner lines plus the 8 control points on the ends of the flag.
> I also assume you compute the remaining control points by interpolation.
> In that case, it should not happen (but you knew that already).
> 
> Can you state more specifics? Which version of POV and possibly show
> some source?

My version is 3.5 for Windows... and here is the code:

#declare fr=20; // Number of frames in animated GIF
#declare amp=0.02; // Amplitude of waving

#declare flag=
union
{
   bicubic_patch
   {
     type 0 flatness 0.01 u_steps 4 v_steps 4
     <0, 0, 0>, <0, 0, 1>, <0, 0, 2>, <0, 0, 3>,
     <1, amp*sin(radians(10+clock*(360/fr))), 0>, <1, 
amp*sin(radians(25+clock*(360/fr))), 1>, <1, 
amp*sin(radians(55+clock*(360/fr))), 2>, <1, 
amp*sin(radians(80+clock*(360/fr))), 3>,
     <2, amp*2*sin(radians(25+clock*(360/fr))), 0>, <2, 
amp*2*sin(radians(45+clock*(360/fr))), 1>, <2, 
amp*2*sin(radians(70+clock*(360/fr))), 2>, <2, 
amp*2*sin(radians(90+clock*(360/fr))), 3>,
     <3, amp*3*sin(radians(35+clock*(360/fr))), 0>, <3, 
amp*3*sin(radians(65+clock*(360/fr))), 1>, <3, 
amp*3*sin(radians(85+clock*(360/fr))), 2>, <3, 
amp*3*sin(radians(105+clock*(360/fr))), 3>
   }
   bicubic_patch
   {
     type 0 flatness 0.01 u_steps 4 v_steps 4
     <3, amp*3*sin(radians(35+clock*(360/fr))), 0>, <3, 
amp*3*sin(radians(65+clock*(360/fr))), 1>, <3, 
amp*3*sin(radians(85+clock*(360/fr))), 2>, <3, 
amp*3*sin(radians(105+clock*(360/fr))), 3>,
     <4, amp*4*sin(radians(50+clock*(360/fr))), 0>, <4, 
amp*4*sin(radians(75+clock*(360/fr))), 1>, <4, 
amp*4*sin(radians(90+clock*(360/fr))), 2>, <4, 
amp*4*sin(radians(120+clock*(360/fr))), 3>,
     <5, amp*5*sin(radians(70+clock*(360/fr))), 0>, <5, 
amp*5*sin(radians(90+clock*(360/fr))), 1>, <5, 
amp*5*sin(radians(110+clock*(360/fr))), 2>, <5, 
amp*5*sin(radians(135+clock*(360/fr))), 3>,
     <6, amp*6*sin(radians(85+clock*(360/fr))), 0>, <6, 
amp*6*sin(radians(100+clock*(360/fr))), 1>, <6, 
amp*6*sin(radians(120+clock*(360/fr))), 2>, <6, 
amp*6*sin(radians(155+clock*(360/fr))), 3>
   }
   bicubic_patch
   {
     type 0 flatness 0.01 u_steps 4 v_steps 4
     <6, amp*6*sin(radians(85+clock*(360/fr))), 0>, <6, 
amp*6*sin(radians(100+clock*(360/fr))), 1>, <6, 
amp*6*sin(radians(120+clock*(360/fr))), 2>, <6, 
amp*6*sin(radians(155+clock*(360/fr))), 3>,
     <7, amp*7*sin(radians(105+clock*(360/fr))), 0>, <7, 
amp*7*sin(radians(125+clock*(360/fr))), 1>, <7, 
amp*7*sin(radians(145+clock*(360/fr))), 2>, <7, 
amp*7*sin(radians(170+clock*(360/fr))), 3>,
     <8, amp*8*sin(radians(125+clock*(360/fr))), 0>, <8, 
amp*8*sin(radians(145+clock*(360/fr))), 1>, <8, 
amp*8*sin(radians(170+clock*(360/fr))), 2>, <8, 
amp*8*sin(radians(195+clock*(360/fr))), 3>,
     <9, amp*9*sin(radians(140+clock*(360/fr))), 0>, <9, 
amp*9*sin(radians(165+clock*(360/fr))), 1>, <9, 
amp*9*sin(radians(180+clock*(360/fr))), 2>, <9, 
amp*9*sin(radians(205+clock*(360/fr))), 3>
   }
   bicubic_patch
   {
     type 0 flatness 0.01 u_steps 4 v_steps 4
     <9, amp*9*sin(radians(140+clock*(360/fr))), 0>, <9, 
amp*9*sin(radians(165+clock*(360/fr))), 1>, <9, 
amp*9*sin(radians(180+clock*(360/fr))), 2>, <9, 
amp*9*sin(radians(205+clock*(360/fr))), 3>
     <10, amp*10*sin(radians(160+clock*(360/fr))), 0>, <10, 
amp*10*sin(radians(175+clock*(360/fr))), 1>, <10, 
amp*10*sin(radians(190+clock*(360/fr))), 2>, <10, 
amp*10*sin(radians(215+clock*(360/fr))), 3>,
     <11, amp*10*sin(radians(180+clock*(360/fr))), 0>, <11, 
amp*10*sin(radians(190+clock*(360/fr))), 1>, <11, 
amp*10*sin(radians(210+clock*(360/fr))), 2>, <11, 
amp*10*sin(radians(230+clock*(360/fr))), 3>,
     <12, amp*10*sin(radians(195+clock*(360/fr))), 0>, <12, 
amp*10*sin(radians(215+clock*(360/fr))), 1>, <12, 
amp*10*sin(radians(235+clock*(360/fr))), 2>, <12, 
amp*10*sin(radians(250+clock*(360/fr))), 3>
   }
   bicubic_patch
   {
     type 0 flatness 0.01 u_steps 4 v_steps 4
     <12, amp*10*sin(radians(195+clock*(360/fr))), 0>, <12, 
amp*10*sin(radians(215+clock*(360/fr))), 1>, <12, 
amp*10*sin(radians(235+clock*(360/fr))), 2>, <12, 
amp*10*sin(radians(250+clock*(360/fr))), 3>,
     <13, amp*10*sin(radians(210+clock*(360/fr))), 0>, <13, 
amp*10*sin(radians(225+clock*(360/fr))), 1>, <13, 
amp*10*sin(radians(240+clock*(360/fr))), 2>, <13, 
amp*10*sin(radians(265+clock*(360/fr))), 3>,
     <14, amp*10*sin(radians(220+clock*(360/fr))), 0>, <14, 
amp*10*sin(radians(235+clock*(360/fr))), 1>, <14, 
amp*10*sin(radians(260+clock*(360/fr))), 2>, <14, 
amp*10*sin(radians(280+clock*(360/fr))), 3>,
     <15, amp*10*sin(radians(240+clock*(360/fr))), 0>, <15, 
amp*10*sin(radians(260+clock*(360/fr))), 1>, <15, 
amp*10*sin(radians(275+clock*(360/fr))), 2>, <15, 
amp*10*sin(radians(295+clock*(360/fr))), 3>
   }

   texture
   {
     pigment
     {
       image_map
       {
         png "h:\lis-spiegel\lis\afghanistan\afghflag.png"
         once
         interpolate 4
       }
       rotate x*90
       scale <15, 1, 3>
     }
     finish { ambient 0.05 diffuse 1.5 brilliance 1 }
   }
}

object
{
   flag
   scale <300, 100, 150>/<15, 1, 3>
}

sky_sphere
{
   pigment { color rgb 1 }
}


light_source
{
   <2000, 50000, 5000>
   color rgb 1
}

camera
{
   location <150, 300, 75>
   look_at <150, 0, 75>
}

> I am not really familiar with isosurfaces, but I think it would be
> slower and you get a 3D object.

I think you mean "finite solid object" rather than just a surface... but 
if I remember well, there should be a way to render just the surface 
even with isosurfaces!

> Good idea, now playin Roundabout (Keys to ascension, Yes),
> Starship Trooper coming up in a minute.

Cool! Raytracing and being a Yes fan seems to go together well... to me,
the music of Yes is like an aural trip to the Hindu Kush!

See you in Khyberspace!

Yadgar


Post a reply to this message

From: andrel
Subject: Re: Bicubic patch artifact [GIF animation, 20 frames, 400 x 300,205KB]
Date: 25 Oct 2004 14:57:41
Message: <417D4C1E.40403@hotmail.com>
[snip]
>     <11, amp*10*sin(radians(180+clock*(360/fr))), 0>, ......
>     <12, amp*10*sin(radians(195+clock*(360/fr))), 0>, ......
>   }
>   bicubic_patch
>   {
>     type 0 flatness 0.01 u_steps 4 v_steps 4
>     <12, amp*10*sin(radians(195+clock*(360/fr))), 0>,  ......
>     <13, amp*10*sin(radians(210+clock*(360/fr))), 0>,  ......
[snip]

basically what you are assuming here is that sin() is a linear function
i.e. that the midpoint between sin(x) and sin(x+delta) is
sin(x+delta/2) and unfortunately it isn't.

This part should be:

     <11, amp*10*sin(radians(180+clock*(360/fr))), 0>, ......
     <12, 
amp*10*(sin(radians(180+clock*(360/fr)))+sin(radians(210+clock*(360/fr))))/2, 
0>,  ......
   }
   bicubic_patch
   {
     type 0 flatness 0.01 u_steps 4 v_steps 4
     <12, 
amp*10*(sin(radians(180+clock*(360/fr)))+sin(radians(210+clock*(360/fr))))/2, 
0>,  ......
     <13, amp*10*sin(radians(210+clock*(360/fr))), 0>,  ......

(I hope I did not miscount this lots of stupid parenteses)

Though I would prefer a somewhat less verbose version ;)

BTW in this case it might not be a problem, but sometimes it is better
to take the used control points equidistant and the interpolated points
at half a distance. Not sure if I am clear, lets try an ASCII drawing:

0---*---*-+-*---*-+-*---*-+-*---*-+-*---*---0

where 0,*, and + are control points for first line of the 5 bicubic
patches. For the total flag the 0 are the endpoints, * the middle
control points and + the points where two bicubic patches meet.

I really hope it is clearer now, but it might just confuse more :( .


Post a reply to this message

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