|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Dear All,
I want to animate the color changing of cube.
This is the simple code I use,
#declare Box =
mesh2{
vertex_vectors{
8,
<0,0,0>,
<10,0,0>,
<10,10,0>,
<0,10,0>,
<0,0,10>,
<10,0,10>,
<0,10,10>,
<10,10,10>,
}
texture_list {
texture{pigment{rgb < 6.1 , 2 , 2 > }}
texture{pigment{rgb < 0 , 2 , 2 > }}
texture{pigment{rgb < .5 , 2 , 2 > }}
texture{pigment{rgb < .2 , 2 , 2 > }}
texture{pigment{rgb < .6 , 2 , 2 > }}
texture{pigment{rgb < 11 , 2 , 2 > }}
texture{pigment{rgb < .2 , 2 , 2 > }}
texture{pigment{rgb < .2 , 2 , 2 > }}
}
face_indices{
12,
< 0 , 1 , 2 >,0 , 1 , 2 ,
< 2 , 3 , 0 >,2 , 3 , 0 ,
< 0 , 1 , 5 >,0 , 1 , 5 ,
< 5 , 4 , 0 >,5 , 4 , 0 ,
< 0 , 3 , 6 >, 0 , 3 , 6 ,
< 6 , 4 , 0 >,6 , 4 , 0 ,
< 4 , 5 , 7 >,4 , 5 , 7 ,
< 7 , 6 , 4 >, 7 , 6 , 4 ,
< 7 , 2 , 3 >,7 , 2 , 3 ,
< 3 , 6 , 7 >,3 , 6 , 7 ,
< 7 , 5 , 1 >,7 , 5 , 1 ,
< 1 , 2 , 7 >,1 , 2 , 7 ,
}
}
object { Box
scale <1,1,1>
rotate <0,0,0> }
Here I each time frame (say 1 Sec interval) I want to change the color.
These color values dont have any mathematical relation, I should give
myself. Say, if I have 10 set of colors, how can I animate this color
change?
Please help me!!!!!!!!!!!
Thanks a lot in advance.
I read in this forum, it suggested that to use csv file format include file
for color change, each line color data refer to each frame. I dont
understand well that point too. If anybody can help me that regard also
useful for me.
Regards,
Renuka.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Renuka nous apporta ses lumieres en ce 24 / 05 / 2007 07:15:
> Dear All,
> I want to animate the color changing of cube.
>
> This is the simple code I use,
> #declare Box =
> mesh2{
> vertex_vectors{
> 8,
> <0,0,0>,
> <10,0,0>,
> <10,10,0>,
> <0,10,0>,
> <0,0,10>,
> <10,0,10>,
> <0,10,10>,
> <10,10,10>,
> }
> texture_list {
> texture{pigment{rgb < 6.1 , 2 , 2 > }}
> texture{pigment{rgb < 0 , 2 , 2 > }}
> texture{pigment{rgb < .5 , 2 , 2 > }}
> texture{pigment{rgb < .2 , 2 , 2 > }}
> texture{pigment{rgb < .6 , 2 , 2 > }}
> texture{pigment{rgb < 11 , 2 , 2 > }}
> texture{pigment{rgb < .2 , 2 , 2 > }}
> texture{pigment{rgb < .2 , 2 , 2 > }}
>
> }
> face_indices{
> 12,
> < 0 , 1 , 2 >,0 , 1 , 2 ,
> < 2 , 3 , 0 >,2 , 3 , 0 ,
> < 0 , 1 , 5 >,0 , 1 , 5 ,
> < 5 , 4 , 0 >,5 , 4 , 0 ,
> < 0 , 3 , 6 >, 0 , 3 , 6 ,
> < 6 , 4 , 0 >,6 , 4 , 0 ,
> < 4 , 5 , 7 >,4 , 5 , 7 ,
> < 7 , 6 , 4 >, 7 , 6 , 4 ,
> < 7 , 2 , 3 >,7 , 2 , 3 ,
> < 3 , 6 , 7 >,3 , 6 , 7 ,
> < 7 , 5 , 1 >,7 , 5 , 1 ,
> < 1 , 2 , 7 >,1 , 2 , 7 ,
> }
> }
>
>
> object { Box
> scale <1,1,1>
> rotate <0,0,0> }
>
> Here I each time frame (say 1 Sec interval) I want to change the color.
> These color values dont have any mathematical relation, I should give
> myself. Say, if I have 10 set of colors, how can I animate this color
> change?
>
> Please help me!!!!!!!!!!!
>
> Thanks a lot in advance.
>
> I read in this forum, it suggested that to use csv file format include file
> for color change, each line color data refer to each frame. I dont
> understand well that point too. If anybody can help me that regard also
> useful for me.
>
> Regards,
> Renuka.
>
>
If you only have 10 sets of textures, you can use the
#switch(frame_number)/#case(Value)/#break structure with 10 entries.
If you have another situation, it may be beter to use splines for your colours.
This enable you to use any arbitrary number of textures with any arbitrary
length animation. Each spline don't have to have the same number of control
points, only the same starting and ending values. One may be a linear_spline and
another a natural_spline.
Once you have all your splines deffined, you travel along them using the clock
system variable (range from 0 to 1 unless set otherwize)
By the way, colour vectors values normaly go from 0 (0%) to 1 (100%). The
colours in your sample will get clipped to that range. For example, rgb<11,2,2>
will render as rgb<1,1,1>. If your original range is 1 to 255, you need to
divide your colours by 255 to avoid problems.
--
Alain
-------------------------------------------------
Practical: Deal with shit one day at a time.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Renuka" <nsi### [at] excitecom> wrote in message
news:web.465573eb6e4fd8f24ac3566b0@news.povray.org...
> Dear All,
> I want to animate the color changing of cube.
>
> This is the simple code I use,
> #declare Box =
> mesh2{
> vertex_vectors{
> 8,
> <0,0,0>,
> <10,0,0>,
> <10,10,0>,
> <0,10,0>,
> <0,0,10>,
> <10,0,10>,
> <0,10,10>,
> <10,10,10>,
> }
> texture_list {
> texture{pigment{rgb < 6.1 , 2 , 2 > }}
> texture{pigment{rgb < 0 , 2 , 2 > }}
> texture{pigment{rgb < .5 , 2 , 2 > }}
> texture{pigment{rgb < .2 , 2 , 2 > }}
> texture{pigment{rgb < .6 , 2 , 2 > }}
> texture{pigment{rgb < 11 , 2 , 2 > }}
> texture{pigment{rgb < .2 , 2 , 2 > }}
> texture{pigment{rgb < .2 , 2 , 2 > }}
>
> }
> face_indices{
> 12,
> < 0 , 1 , 2 >,0 , 1 , 2 ,
> < 2 , 3 , 0 >,2 , 3 , 0 ,
> < 0 , 1 , 5 >,0 , 1 , 5 ,
> < 5 , 4 , 0 >,5 , 4 , 0 ,
> < 0 , 3 , 6 >, 0 , 3 , 6 ,
> < 6 , 4 , 0 >,6 , 4 , 0 ,
> < 4 , 5 , 7 >,4 , 5 , 7 ,
> < 7 , 6 , 4 >, 7 , 6 , 4 ,
> < 7 , 2 , 3 >,7 , 2 , 3 ,
> < 3 , 6 , 7 >,3 , 6 , 7 ,
> < 7 , 5 , 1 >,7 , 5 , 1 ,
> < 1 , 2 , 7 >,1 , 2 , 7 ,
> }
> }
>
>
> object { Box
> scale <1,1,1>
> rotate <0,0,0> }
>
> Here I each time frame (say 1 Sec interval) I want to change the color.
> These color values dont have any mathematical relation, I should give
> myself. Say, if I have 10 set of colors, how can I animate this color
> change?
>
> Please help me!!!!!!!!!!!
>
> Thanks a lot in advance.
>
> I read in this forum, it suggested that to use csv file format include
> file
> for color change, each line color data refer to each frame. I dont
> understand well that point too. If anybody can help me that regard also
> useful for me.
>
> Regards,
> Renuka.
>
Hi Renuka,
You could assign the color values to a 2 dimensional array and then use the
frame number to select the appropriate array dimension for a specific frame
of the animation.
The following example uses a 4 x 8 array where the first dimension stores
the number for the frame and the second defines the vertex color.
I then used a #while loop to write the color into the appropriate position
of the texture list.
To read these values from a csv file, (e.g. if the values are generated
outside of POVRay) you can create a file in much the same format with 8
vectors on each line (no squiggly brackets), then use the 'read' directive
to read the appropriate line for a given frame.
Hope this helps,
Regards,
Chris B.
camera {location <20,30,-10> look_at <5,5,5>}
light_source {<30, 20, -300> color rgb 1}
#declare MyFrameNumber = 1;
#declare ColourArray = array[4][8] {
{<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
{<1,1,0>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
{<1,1,0>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
{<1,1,0>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
};
#declare Box = mesh2{
vertex_vectors{
8,
<0,0,0>,
<10,0,0>,
<10,10,0>,
<0,10,0>,
<0,0,10>,
<10,0,10>,
<0,10,10>,
<10,10,10>,
}
texture_list {
8
#local I = 0;
#while (I<8)
texture{pigment{rgb ColourArray[MyFrameNumber][I]}}
#local I = I + 1;
#end
}
face_indices{
12,
< 0 , 1 , 2 >,0 , 1 , 2 ,
< 2 , 3 , 0 >,2 , 3 , 0 ,
< 0 , 1 , 5 >,0 , 1 , 5 ,
< 5 , 4 , 0 >,5 , 4 , 0 ,
< 0 , 3 , 6 >, 0 , 3 , 6 ,
< 6 , 4 , 0 >,6 , 4 , 0 ,
< 4 , 5 , 7 >,4 , 5 , 7 ,
< 7 , 6 , 4 >, 7 , 6 , 4 ,
< 7 , 2 , 3 >,7 , 2 , 3 ,
< 3 , 6 , 7 >,3 , 6 , 7 ,
< 7 , 5 , 1 >,7 , 5 , 1 ,
< 1 , 2 , 7 >,1 , 2 , 7 ,
}
}
object { Box
scale <1,1,1>
rotate <0,0,0> }
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
..
> >
> >
> If you only have 10 sets of textures, you can use the
> #switch(frame_number)/#case(Value)/#break structure with 10 entries.
> If you have another situation, it may be beter to use splines for your colours.
> This enable you to use any arbitrary number of textures with any arbitrary
> length animation. Each spline don't have to have the same number of control
> points, only the same starting and ending values. One may be a linear_spline and
> another a natural_spline.
> Once you have all your splines deffined, you travel along them using the clock
> system variable (range from 0 to 1 unless set otherwize)
> By the way, colour vectors values normaly go from 0 (0%) to 1 (100%). The
> colours in your sample will get clipped to that range. For example, rgb<11,2,2>
> will render as rgb<1,1,1>. If your original range is 1 to 255, you need to
> divide your colours by 255 to avoid problems.
>
> --
> Alain
> -------------------------------------------------
> Practical: Deal with shit one day at a time.
Dear Alain,
Thank you very much for your help. I hope spline concept is good for my
purpose. If you have any sample spline animation sample program, can you
please give me?
Thanks a lot.
Rgds,
Renuka.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>
> Hi Renuka,
> You could assign the color values to a 2 dimensional array and then use the
> frame number to select the appropriate array dimension for a specific frame
> of the animation.
>
> The following example uses a 4 x 8 array where the first dimension stores
> the number for the frame and the second defines the vertex color.
> I then used a #while loop to write the color into the appropriate position
> of the texture list.
>
> To read these values from a csv file, (e.g. if the values are generated
> outside of POVRay) you can create a file in much the same format with 8
> vectors on each line (no squiggly brackets), then use the 'read' directive
> to read the appropriate line for a given frame.
>
> Hope this helps,
> Regards,
> Chris B.
>
> camera {location <20,30,-10> look_at <5,5,5>}
> light_source {<30, 20, -300> color rgb 1}
> #declare MyFrameNumber = 1;
>
> #declare ColourArray = array[4][8] {
>
{<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
>
{<1,1,0>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
>
{<1,1,0>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
>
{<1,1,0>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
> };
>
>
> #declare Box = mesh2{
> vertex_vectors{
> 8,
> <0,0,0>,
> <10,0,0>,
> <10,10,0>,
> <0,10,0>,
> <0,0,10>,
> <10,0,10>,
> <0,10,10>,
> <10,10,10>,
> }
> texture_list {
> 8
> #local I = 0;
> #while (I<8)
> texture{pigment{rgb ColourArray[MyFrameNumber][I]}}
> #local I = I + 1;
> #end
> }
> face_indices{
> 12,
> < 0 , 1 , 2 >,0 , 1 , 2 ,
> < 2 , 3 , 0 >,2 , 3 , 0 ,
> < 0 , 1 , 5 >,0 , 1 , 5 ,
> < 5 , 4 , 0 >,5 , 4 , 0 ,
> < 0 , 3 , 6 >, 0 , 3 , 6 ,
> < 6 , 4 , 0 >,6 , 4 , 0 ,
> < 4 , 5 , 7 >,4 , 5 , 7 ,
> < 7 , 6 , 4 >, 7 , 6 , 4 ,
> < 7 , 2 , 3 >,7 , 2 , 3 ,
> < 3 , 6 , 7 >,3 , 6 , 7 ,
> < 7 , 5 , 1 >,7 , 5 , 1 ,
> < 1 , 2 , 7 >,1 , 2 , 7 ,
> }
> }
>
>
> object { Box
> scale <1,1,1>
> rotate <0,0,0> }
Hi Charis,
I am very thankful for your kind help. I tried your coding, but it didnt
animate. How should I animate your coding? Please help me.
Thank you.
Rgds,
Renuka.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Renuka nous apporta ses lumieres en ce 25 / 05 / 2007 03:58:
>> Hi Renuka,
>> You could assign the color values to a 2 dimensional array and then use the
>> frame number to select the appropriate array dimension for a specific frame
>> of the animation.
>>
>> The following example uses a 4 x 8 array where the first dimension stores
>> the number for the frame and the second defines the vertex color.
>> I then used a #while loop to write the color into the appropriate position
>> of the texture list.
>>
>> To read these values from a csv file, (e.g. if the values are generated
>> outside of POVRay) you can create a file in much the same format with 8
>> vectors on each line (no squiggly brackets), then use the 'read' directive
>> to read the appropriate line for a given frame.
>>
>> Hope this helps,
>> Regards,
>> Chris B.
>>
>> camera {location <20,30,-10> look_at <5,5,5>}
>> light_source {<30, 20, -300> color rgb 1}
>> #declare MyFrameNumber = 1;
>>
>> #declare ColourArray = array[4][8] {
>>
{<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
>>
{<1,1,0>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
>>
{<1,1,0>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
>>
{<1,1,0>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>,<0,1,1>,<0.5,1,1>,<0.8,0.5,0.9>,<1,0.5,0.4>}
>> };
>>
>>
>> #declare Box = mesh2{
>> vertex_vectors{
>> 8,
>> <0,0,0>,
>> <10,0,0>,
>> <10,10,0>,
>> <0,10,0>,
>> <0,0,10>,
>> <10,0,10>,
>> <0,10,10>,
>> <10,10,10>,
>> }
>> texture_list {
>> 8
>> #local I = 0;
>> #while (I<8)
>> texture{pigment{rgb ColourArray[MyFrameNumber][I]}}
>> #local I = I + 1;
>> #end
>> }
>> face_indices{
>> 12,
>> < 0 , 1 , 2 >,0 , 1 , 2 ,
>> < 2 , 3 , 0 >,2 , 3 , 0 ,
>> < 0 , 1 , 5 >,0 , 1 , 5 ,
>> < 5 , 4 , 0 >,5 , 4 , 0 ,
>> < 0 , 3 , 6 >, 0 , 3 , 6 ,
>> < 6 , 4 , 0 >,6 , 4 , 0 ,
>> < 4 , 5 , 7 >,4 , 5 , 7 ,
>> < 7 , 6 , 4 >, 7 , 6 , 4 ,
>> < 7 , 2 , 3 >,7 , 2 , 3 ,
>> < 3 , 6 , 7 >,3 , 6 , 7 ,
>> < 7 , 5 , 1 >,7 , 5 , 1 ,
>> < 1 , 2 , 7 >,1 , 2 , 7 ,
>> }
>> }
>>
>>
>> object { Box
>> scale <1,1,1>
>> rotate <0,0,0> }
>
> Hi Charis,
> I am very thankful for your kind help. I tried your coding, but it didnt
> animate. How should I animate your coding? Please help me.
>
> Thank you.
>
> Rgds,
> Renuka.
>
>
Replace "MyFrameNumber" by frame_number. This sample will only work for a 4
frame animation.
--
Alain
-------------------------------------------------
BACHELOR: A man who never makes the same mistake once.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> >
> >
> Replace "MyFrameNumber" by frame_number. This sample will only work for a 4
> frame animation.
>
> --
> Alain
> -------------------------------------------------
> BACHELOR: A man who never makes the same mistake once.
Dear Alain,
Thanks for ur reply.
You mean that I should change frame number each time and save the image and
using some other software to make video clip of those images.
Can't POV-ray make animation itself?
-------
Renuka
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"Renuka" <nsi### [at] excitecom> wrote:
> > >
> > >
> > Replace "MyFrameNumber" by frame_number. This sample will only work for a 4
> > frame animation.
> >
> > --
> > Alain
> > -------------------------------------------------
> > BACHELOR: A man who never makes the same mistake once.
>
>
> Dear Alain,
> Thanks for ur reply.
> You mean that I should change frame number each time and save the image and
> using some other software to make video clip of those images.
>
> Can't POV-ray make animation itself?
Renuka, PovRay only outputs a series of images which you have to convert
into an animation using a third party program. I use TMPGEnc to build mpeg
animations. Also in PovRay you need to tell it to create a series by using
command line switches or an INI file to control the render. See; 3.1.2
Command-line Options and 3.1.2.1.2 Internal Animation Loop.
Stephen
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Renuka nous apporta ses lumieres en ce 25 / 05 / 2007 05:57:
>>>
>> Replace "MyFrameNumber" by frame_number. This sample will only work for a 4
>> frame animation.
>>
>> --
>> Alain
>> -------------------------------------------------
>> BACHELOR: A man who never makes the same mistake once.
>
>
> Dear Alain,
> Thanks for ur reply.
> You mean that I should change frame number each time and save the image
Not at all. All you need to do, is to use +kff4 in the "command line" box and
replace the user deffined variable "MyFrameNumber" by the predeffined variable
"frame_number" and start the rendering process as usual.
If you try +kff5 or use a larger numerical value, you'll get an out of bound
error as the provided array have only 4 entries.
With the sample code provided, you'll get 4 images named after the source file
name plus the numbers 1, 2, 3 and 4 apended.
and
> using some other software to make video clip of those images.
Yes.
>
> Can't POV-ray make animation itself?
POV-Ray is a renderer, not an animation programm.
>
> -------
> Renuka
>
>
>
POV-Ray can render the various stills needed for your animation, but it can't
take them to generate the video. The reason, is that there are just to many
possible formats you may want, or need, to use: animated GIF, animated PNG (MNG,
MPG), AVI (many variations), JPG, JPEG, DivX, Xvid, MOV, many others... And the
fact that some of those need closed sourced, proprietary software to do the job.
--
Alain
-------------------------------------------------
I used to have an open mind but my brains kept falling out.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>> Can't POV-ray make animation itself?
>
> POV-Ray is a renderer, not an animation programm.
>
> POV-Ray can render the various stills needed for your animation, but it
> can't take them to generate the video. The reason, is that there are just
> to many possible formats you may want, or need, to use: animated GIF,
> animated PNG (MNG, MPG), AVI (many variations), JPG, JPEG, DivX, Xvid,
> MOV, many others... And the fact that some of those need closed sourced,
> proprietary software to do the job.
It would be useful though, if POV could make use of any codecs you have
installed, like most other programs do that output a series of images
designed to be animated. AIUI all the hard work is done by the codec
(including the options dialog boxes etc) so all POV would need to do is
present the user with a list of codecs and then use the one that was
selected.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|