POV-Ray : Newsgroups : povray.advanced-users : Repeating Patterns Server Time
5 Jul 2024 16:12:19 EDT (-0400)
  Repeating Patterns (Message 1 to 7 of 7)  
From: bugman
Subject: Repeating Patterns
Date: 20 Sep 2007 03:55:01
Message: <web.46f226a53f8015ea7a1f45c00@news.povray.org>
I made a simple animation that kind of looks like the sun, using the
following basic method:

camera{location <0,0,-2.25> look_at <0,0,0>}
sphere {<0,0,0>,1 pigment{bumps scale 0.25 translate <0,0,clock>}
finish{ambient 1}}

Initial_Clock=0
Final_Clock=1
Cyclic_Animation=on

The only problem is that I want the animation to loop so that the final
picture is continuous with the initial picture. I thought the "bumps",
"spotted", and "bozo" patterns would do this for me, but apparently they
are not a repeating patterns. Is there any way for POV-Ray to make
repeating patterns that resemble these patterns?


Post a reply to this message

From: honnza
Subject: Re: Repeating Patterns
Date: 20 Sep 2007 04:30:01
Message: <web.46f22f45d8fa0949a9ce4df50@news.povray.org>
"bugman" <nomail@nomail> wrote:
> I made a simple animation that kind of looks like the sun, using the
> following basic method:
>
> camera{location <0,0,-2.25> look_at <0,0,0>}
> sphere {<0,0,0>,1 pigment{bumps scale 0.25 translate <0,0,clock>}
> finish{ambient 1}}
>
> Initial_Clock=0
> Final_Clock=1
> Cyclic_Animation=on
>
> The only problem is that I want the animation to loop so that the final
> picture is continuous with the initial picture. I thought the "bumps",
> "spotted", and "bozo" patterns would do this for me, but apparently they
> are not a repeating patterns. Is there any way for POV-Ray to make
> repeating patterns that resemble these patterns?

maybe you could use warp{repeat offset z/2 flip z}


Post a reply to this message

From: Alain
Subject: Re: Repeating Patterns
Date: 20 Sep 2007 09:30:50
Message: <46f2760a$1@news.povray.org>
bugman nous apporta ses lumieres en ce 2007/09/20 03:52:
> I made a simple animation that kind of looks like the sun, using the
> following basic method:
> 
> camera{location <0,0,-2.25> look_at <0,0,0>}
> sphere {<0,0,0>,1 pigment{bumps scale 0.25 translate <0,0,clock>}
> finish{ambient 1}}
> 
> Initial_Clock=0
> Final_Clock=1
> Cyclic_Animation=on
> 
> The only problem is that I want the animation to loop so that the final
> picture is continuous with the initial picture. I thought the "bumps",
> "spotted", and "bozo" patterns would do this for me, but apparently they
> are not a repeating patterns. Is there any way for POV-Ray to make
> repeating patterns that resemble these patterns?
> 
> 
> 
Instead of using translate, use a rotation. If you don't want the rotation to 
look like a rotation but a translation, place your object away from the origin 
then apply the rotation on the pattern:
#declare Offset = 5;
sphere {Offset*x,1 //put the sphere away from the origin
	pigment{bumps scale 0.25 rotate <0,0,clock*360>//rotate the pattern
// *360 so that it does a full rotation
// you can substitute z for x if you want it to show a lateral movement
	translate -Offset*x //put it back at the origin
}
bumps = bozo minus the builtin colour_map

leopard is a periodic pattern

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you downloaded and printed the 
Renderman Interface documentation, so you'd have a little light reading to take 
on holiday.
Alex McLeod a.k.a. Giant Robot Messiah


Post a reply to this message

From: Alain
Subject: Re: Repeating Patterns
Date: 20 Sep 2007 09:36:13
Message: <46f2774d@news.povray.org>
honnza nous apporta ses lumieres en ce 2007/09/20 04:28:
> "bugman" <nomail@nomail> wrote:
>> I made a simple animation that kind of looks like the sun, using the
>> following basic method:
>>
>> camera{location <0,0,-2.25> look_at <0,0,0>}
>> sphere {<0,0,0>,1 pigment{bumps scale 0.25 translate <0,0,clock>}
>> finish{ambient 1}}
>>
>> Initial_Clock=0
>> Final_Clock=1
>> Cyclic_Animation=on
>>
>> The only problem is that I want the animation to loop so that the final
>> picture is continuous with the initial picture. I thought the "bumps",
>> "spotted", and "bozo" patterns would do this for me, but apparently they
>> are not a repeating patterns. Is there any way for POV-Ray to make
>> repeating patterns that resemble these patterns?
> 
> maybe you could use warp{repeat offset z/2 flip z}
> 
> 
This will give you a banded aspect. The repeat warp will repeat a particular 
strip of the pattern with very visible seams. Also, the offset will cause each 
strip to use a different part of the pattern, increasing the visibility of the 
seams.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when you keep a blacklist of people who 
ask questions about 3DFX products.
Alex McLeod a.k.a. Giant Robot Messiah


Post a reply to this message

From: Chris B
Subject: Re: Repeating Patterns
Date: 20 Sep 2007 13:47:15
Message: <46f2b223$1@news.povray.org>
"Alain" <ele### [at] netscapenet> wrote in message 
news:46f2774d@news.povray.org...
> honnza nous apporta ses lumieres en ce 2007/09/20 04:28:
>> "bugman" <nomail@nomail> wrote:
>>> I made a simple animation that kind of looks like the sun, using the
>>> following basic method:
>>>
>>> camera{location <0,0,-2.25> look_at <0,0,0>}
>>> sphere {<0,0,0>,1 pigment{bumps scale 0.25 translate <0,0,clock>}
>>> finish{ambient 1}}
>>>
>>> Initial_Clock=0
>>> Final_Clock=1
>>> Cyclic_Animation=on
>>>
>>> The only problem is that I want the animation to loop so that the final
>>> picture is continuous with the initial picture. I thought the "bumps",
>>> "spotted", and "bozo" patterns would do this for me, but apparently they
>>> are not a repeating patterns. Is there any way for POV-Ray to make
>>> repeating patterns that resemble these patterns?
>>
>> maybe you could use warp{repeat offset z/2 flip z}
>>
>>
> This will give you a banded aspect. The repeat warp will repeat a 
> particular strip of the pattern with very visible seams. Also, the offset 
> will cause each strip to use a different part of the pattern, increasing 
> the visibility of the seams.
>
> -- 
> Alain

Hi,

I was going to suggest rotation as Alain did, but the problem with rotation 
is that you need a centre of rotation some way away (e.g. 5 times the 
radius) to avoid a sensation of an unbalanced movement in the texture and 
with a fairly detailed pattern it then needs a heck of a lot of frames to 
get a smooth repeating cycle (with a small bumps scale I reckon it would 
need several hundred frames).

I tried fiddling with Honnza's 'warp' and 'flip' idea and you can get rid of 
the seams that Alain mentioned, but you still see the reverse in direction, 
so it seems to twist back and forth. With the following example you get a 
smooth repeat in about 30 frames and with the original, bigger bumps you 
could reduce the number of frames further.

#declare depth = 0.175;
sphere {<0,0,0>,1 pigment{bumps scale 0.05 warp{repeat depth*z  flip z} 
translate <0,0,2*depth*clock>} finish{ambient 1.5}}

Although a tad more complicated, you can get a better result by 'building' a 
repeating pattern using the gradient pattern. The following example uses 
displaced copies of the same pattern to create a repeat, avoiding the back 
and forth motion caused by the 'warp' and 'flip'. This creates 5x1 unit long 
copies of the same repeating pattern, then moves the pigment back so that it 
can move forward through the sphere by 1 unit over the animation cycle 
without any of the sphere being outside of the repeating pattern. This gives 
you a fine-grained control over the frequency of the repeat and the number 
of frames in your animation cycle.

camera{location <0,0,-2.25> look_at <0,0,0>}

#declare Sun_BasePigment = pigment {
  bumps turbulence 0.5
  pigment_map {
    [0.0 color rgb<0.7,0.35,0>]
    [0.5 color rgb<1,0.8,0>]
    [1.0 color rgb<0.7,0.35,0>]
  }
}

#declare Sun_Pigment = pigment {
  gradient z
  pigment_map {
    [0.0, Sun_BasePigment scale 0.05]
    [0.2, Sun_BasePigment scale 0.05 translate z*0.2]
    [0.4, Sun_BasePigment scale 0.05 translate z*0.4]
    [0.6, Sun_BasePigment scale 0.05 translate z*0.6]
    [0.8, Sun_BasePigment scale 0.05 translate z*0.8]
    [1.0, Sun_BasePigment scale 0.05 translate z*1.0]
  }
  scale 5*z
}

sphere {<0,0,0>,1
  pigment {Sun_Pigment translate <0,0,-3+clock>}
  finish{ambient 1.2}
}


Hope this helps.
Regards,
Chris B.


Post a reply to this message

From: Alain
Subject: Re: Repeating Patterns
Date: 21 Sep 2007 10:30:31
Message: <46f3d587@news.povray.org>
Chris B nous apporta ses lumieres en ce 2007/09/20 13:47:
> "Alain" <ele### [at] netscapenet> wrote in message 
> news:46f2774d@news.povray.org...
>> honnza nous apporta ses lumieres en ce 2007/09/20 04:28:
>>> "bugman" <nomail@nomail> wrote:
>>>> I made a simple animation that kind of looks like the sun, using the
>>>> following basic method:
>>>>
>>>> camera{location <0,0,-2.25> look_at <0,0,0>}
>>>> sphere {<0,0,0>,1 pigment{bumps scale 0.25 translate <0,0,clock>}
>>>> finish{ambient 1}}
>>>>
>>>> Initial_Clock=0
>>>> Final_Clock=1
>>>> Cyclic_Animation=on
>>>>
>>>> The only problem is that I want the animation to loop so that the final
>>>> picture is continuous with the initial picture. I thought the "bumps",
>>>> "spotted", and "bozo" patterns would do this for me, but apparently they
>>>> are not a repeating patterns. Is there any way for POV-Ray to make
>>>> repeating patterns that resemble these patterns?
>>> maybe you could use warp{repeat offset z/2 flip z}
>>>
>>>
>> This will give you a banded aspect. The repeat warp will repeat a 
>> particular strip of the pattern with very visible seams. Also, the offset 
>> will cause each strip to use a different part of the pattern, increasing 
>> the visibility of the seams.
>>
>> -- 
>> Alain
> 
> Hi,
> 
> I was going to suggest rotation as Alain did, but the problem with rotation 
> is that you need a centre of rotation some way away (e.g. 5 times the 
> radius) to avoid a sensation of an unbalanced movement in the texture and 
> with a fairly detailed pattern it then needs a heck of a lot of frames to 
> get a smooth repeating cycle (with a small bumps scale I reckon it would 
> need several hundred frames).
> 
> I tried fiddling with Honnza's 'warp' and 'flip' idea and you can get rid of 
> the seams that Alain mentioned, but you still see the reverse in direction, 
> so it seems to twist back and forth. With the following example you get a 
> smooth repeat in about 30 frames and with the original, bigger bumps you 
> could reduce the number of frames further.
> 
> #declare depth = 0.175;
> sphere {<0,0,0>,1 pigment{bumps scale 0.05 warp{repeat depth*z  flip z} 
> translate <0,0,2*depth*clock>} finish{ambient 1.5}}
> 
> Although a tad more complicated, you can get a better result by 'building' a 
> repeating pattern using the gradient pattern. The following example uses 
> displaced copies of the same pattern to create a repeat, avoiding the back 
> and forth motion caused by the 'warp' and 'flip'. This creates 5x1 unit long 
> copies of the same repeating pattern, then moves the pigment back so that it 
> can move forward through the sphere by 1 unit over the animation cycle 
> without any of the sphere being outside of the repeating pattern. This gives 
> you a fine-grained control over the frequency of the repeat and the number 
> of frames in your animation cycle.
> 
> camera{location <0,0,-2.25> look_at <0,0,0>}
> 
> #declare Sun_BasePigment = pigment {
>   bumps turbulence 0.5
>   pigment_map {
>     [0.0 color rgb<0.7,0.35,0>]
>     [0.5 color rgb<1,0.8,0>]
>     [1.0 color rgb<0.7,0.35,0>]
>   }
> }
> 
> #declare Sun_Pigment = pigment {
>   gradient z
>   pigment_map {
>     [0.0, Sun_BasePigment scale 0.05]
>     [0.2, Sun_BasePigment scale 0.05 translate z*0.2]
>     [0.4, Sun_BasePigment scale 0.05 translate z*0.4]
>     [0.6, Sun_BasePigment scale 0.05 translate z*0.6]
>     [0.8, Sun_BasePigment scale 0.05 translate z*0.8]
>     [1.0, Sun_BasePigment scale 0.05 translate z*1.0]
>   }
>   scale 5*z
> }
> 
> sphere {<0,0,0>,1
>   pigment {Sun_Pigment translate <0,0,-3+clock>}
>   finish{ambient 1.2}
> }
> 
> 
> Hope this helps.
> Regards,
> Chris B.
> 
> 
> 
> 
Another possibility that I did'nt think immediately:
In cases similar to yours, the use of the phase keyword may be a possible solution.
1 - create your base texture as you want.
2 - ADD in the texture block "phase clock"

You get:
sphere{0,1
	pigment{Sun_Pigment phase clock}
	finish{ambient 1.2}
}
As the value for phase goes from 0 to 1, the values of the map get shifted in a 
circle.

-- 
Alain
-------------------------------------------------
For a people who are free, and who mean to remain so, a well-organized and
armed militia is their best security.
Thomas Jefferson


Post a reply to this message

From: bugman
Subject: Re: Repeating Patterns
Date: 22 Sep 2007 18:00:01
Message: <web.46f58fbed8fa0949cafca3fe0@news.povray.org>
Thank you everyone for the suggestions. I decided to use the warp method.
Here are some animations:
http://bugman123.com/Fractals/Sun.gif
http://bugman123.com/Fractals/Sun.m1v

camera{orthographic location <0,0,-2> look_at <0,0,0>}
sphere {0,1
 pigment{bumps
  color_map{[0 rgb 0][1/3 rgb 0.5*x][2/3 rgb <1,0.5,0>][1 rgb 1]}
  scale 0.5 warp{repeat z/2 flip z} turbulence 5 translate <0,0,-clock>
 }
 finish{ambient 1.5}
}


Post a reply to this message

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