|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi. I'm a newbie of using POV-ray to make animation
I've read the documentation, but still can't get the ideas to make
animation.
Suppose I need to make a 10-frames animation. In each frame, a box will be
placed upon the other, like a stack.
How can I control the variable "clock"? And how about the ini file?
Please tell me the basic concept of making animation?
Thank you for your help!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
John Keing wrote:
>
> Hi. I'm a newbie of using POV-ray to make animation
snip
> Please tell me the basic concept of making animation?
Check out this tutorial - http://www.puzzlecraft.com/cm/ClockMod.html
--
Ken Tyler
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hmmmm, you know what? I didn't realize that tutorial suggests using the
povray.ini file for your animation setup. I hadn't seen it in so long, and I
don't know if I ever read it word for word before, so I was curious how it
went about teaching that.
So, John, you might want to go about creating your own INI file for putting
all the animation keywords in. That way it's a simple matter of opening that
file for animations and no need to do commenting out of things listed in
your "master" povray.ini.
Since I'm replying here I might as well throw in the fastest possible way to
get a 10 frame animation of stacking boxes. Put the following into the
command-line (if Windows there anyway):
+kfi1 +kff10
Then for the box stacking, put this into your scene (pov) file:
#declare Count=0;
#while (Count<5*clock) // stack 5 boxes
box {
-1,1
pigment {
rgb <1-Count/5,0,Count/5>*9 // luminous color
}
translate <0,2*Count,20>
}
#declare Count=Count+1;
#end
The command-line switches are frames 1 to 10, clock 0 to 1 is implied by
default so it isn't needed.
The example scene will render as is, no camera or light needed. You could
also add a rotate 360*clock*y so the boxes turn as they stack. Maybe this
will be a very quick way for you to see how it works, with the #while loop
acting to keep the previous boxes in place instead of just moving a single
box upward.
It can take time to learn all the keywords and how they can be used to
manipulate animations, so check out that clock tutorial; also read the Help
in POV concerning "animation output" using all those possible switches and
keywords.
Bob Hughes
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"hughes, b." wrote:
>
> Hmmmm, you know what? I didn't realize that tutorial suggests using the
> povray.ini file for your animation setup. I hadn't seen it in so long, and I
> don't know if I ever read it word for word before, so I was curious how it
> went about teaching that.
That's the approach I have always taken simply because it is easy to access
from the tools menu. I don't do many animations so it's not that much of a
hassle. Your approach is probably better for the hard core animation producer.
--
Ken Tyler
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thank you for your advice.
I have tried it and seen the scene , but still got some questions.
Actually, I'm not so familiar with povray. I've read its help documents, but
still can't find any help.
I've got the following questions, hope you can explain them to me. Thanks.
1) In your code for defining a box, what does "-1,1" mean? I know we need to
take 2 opposite 3D corners for defining a box.
2) There are 10 frames, so the clock takes approximately 0.11 for each
frame. Am I right?
So, for frame 1, clock=0, Count=0 ==> no box is created
for frame 2, clock=0.11, Count=0, Count<5*clock is true==> first
box is created and Count=1
for frame 3, clock=0.22, Count=1, Count<5*clock is true==>second
box is created and Count=2
problem comes for frame 4, clock=0.33, Count=2, Count<5*clock is
false==>no box is created! However, another new box is
created! Why? The program should go out the while loop.
Also, how can you determine "Count<5*clock" can stack 5 boxes only?
3) I would like to know the relationship between the frame, clock and the
objects appear in each frame.
How do they work out to show an animation?
4) The example you gave is simple to let me know how to generate animation.
However, if I want to display an alphabet by boxes
say , "C", how can I do that?
It's not the same as stacking the boxes in one direction. Could you
please show me the ways of doing this? I mean how you design the
scene. Also, how to determine the number of frames are appropriate?
I'm really frustrated about the ways to use povray for making animation.
5) My final question is I have added the following code to your example:
camera {
location <5, 3, -8>
look_at <4, 3, 0>
}
light_source {
<0, 10, -10> White
}
plane {
y, 0
texture {
pigment { checker color White color Green }
}
}
sky_sphere { S_Cloud5 }
Why the first created box looks smaller than the others? However, every box
looks the same size if the above code is not added.
Sorry for so many questions. If I don't have a good and clear concept, I
know I can't move on to do anything.
Hope you can help me!
Thank you!
"hughes, b." <omn### [at] charternet> wrote in message
news:3db36c35@news.povray.org...
> Hmmmm, you know what? I didn't realize that tutorial suggests using the
> povray.ini file for your animation setup. I hadn't seen it in so long, and
I
> don't know if I ever read it word for word before, so I was curious how it
> went about teaching that.
>
> So, John, you might want to go about creating your own INI file for
putting
> all the animation keywords in. That way it's a simple matter of opening
that
> file for animations and no need to do commenting out of things listed in
> your "master" povray.ini.
>
> Since I'm replying here I might as well throw in the fastest possible way
to
> get a 10 frame animation of stacking boxes. Put the following into the
> command-line (if Windows there anyway):
>
> +kfi1 +kff10
>
> Then for the box stacking, put this into your scene (pov) file:
>
> #declare Count=0;
>
> #while (Count<5*clock) // stack 5 boxes
>
> box {
> -1,1
> pigment {
> rgb <1-Count/5,0,Count/5>*9 // luminous color
> }
> translate <0,2*Count,20>
> }
>
> #declare Count=Count+1;
>
> #end
>
> The command-line switches are frames 1 to 10, clock 0 to 1 is implied by
> default so it isn't needed.
> The example scene will render as is, no camera or light needed. You could
> also add a rotate 360*clock*y so the boxes turn as they stack. Maybe this
> will be a very quick way for you to see how it works, with the #while loop
> acting to keep the previous boxes in place instead of just moving a single
> box upward.
> It can take time to learn all the keywords and how they can be used to
> manipulate animations, so check out that clock tutorial; also read the
Help
> in POV concerning "animation output" using all those possible switches and
> keywords.
>
> Bob Hughes
>
>
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"John Keing" <joh### [at] yahoocom> wrote in message
news:3db5b520@news.povray.org...
>
> I've got the following questions, hope you can explain them to me. Thanks.
Okay, hope I can answer in a way you understand.
> 1) In your code for defining a box, what does "-1,1" mean? I know we need
to
> take 2 opposite 3D corners for defining a box.
In many of the primitive shapes floats immediately after the first brace are
converted to vectors so 1 is really <1,1,1>. An example of something that
doesn't do that is torus {}, but sphere {} does. box {} takes two, sphere {}
only one.
> 2) There are 10 frames, so the clock takes approximately 0.11 for each
> frame. Am I right?
Yes, you can check it by using keyword clock_delta to write to the message
stream. It is a subclock value per frame. So:
#debug concat("Per frame clock value is ",str(clock_delta,1,-1),"\n")
will do that.
> So, for frame 1, clock=0, Count=0 ==> no box is created
> for frame 2, clock=0.11, Count=0, Count<5*clock is true==> first
> box is created and Count=1
> for frame 3, clock=0.22, Count=1, Count<5*clock is true==>second
> box is created and Count=2
> problem comes for frame 4, clock=0.33, Count=2, Count<5*clock is
> false==>no box is created! However, another new box is
> created! Why? The program should go out the while loop.
>
> Also, how can you determine "Count<5*clock" can stack 5 boxes only?
It's just math (ha-ha)... Actually, frame_number instead of clock for such
things can be far more intuitive. It does get a bit deceptive unless you are
certain of what clock is doing. Even if int(clock*10) is used you end up
with 0,1,2,3,4,5,6,7,8,10 and no 9. Not exactly expected, but for the
example it doesn't matter. I'm not sure of the reason for this myself, I
don't remember past conversations about it which I'm fairly certain have
occured.
Idea was to go from 0 to 4 which equals 5 steps. It could also be 1 to 5,
(Count<6).
> 3) I would like to know the relationship between the frame, clock and the
> objects appear in each frame.
>
> How do they work out to show an animation?
Easy. All objects (including camera, lights, unions, etc.) with a clock
variable used within their statements will shift, by the amount specified in
the clock equation, for every frame. Since clock is often set to run from 0
to 1 that means
box {-1,1 translate <3,0,0>*clock
is going to move that box 3 POV units to the positive x direction over the
course of however many frames you state. And thats the relationship between
clock and frames, doesn't matter what number of them you use, whether 10 or
100 it will still only move 3 units. The factor here then is speed, a 10
frame animation of that will look like the box jumps right over to the side
and a 100 frame animation will look like it is slowly sliding across.
> 4) The example you gave is simple to let me know how to generate
animation.
> However, if I want to display an alphabet by boxes
> say , "C", how can I do that?
>
> It's not the same as stacking the boxes in one direction. Could you
> please show me the ways of doing this? I mean how you design the
> scene. Also, how to determine the number of frames are appropriate?
What you'd be doing is creating a text object placed onto a box, either by
intersection or difference, or even union of the two primitives.
Let's say you want each lettered box to appear for 10 frames. You'd need a
270 frame animation so each letter is shown in succession 26 times. 0 to 10,
10 to 20, etc. up to 260 to 270 so that the last letter is inclusive.
#switch (clock) // frame_number here instead would be better...
#range (0*clock_delta,1*clock_delta) // ... so ranges would then be
(0,10)...
object {AlphabetBox_A}
#break
#range (1*clock_delta,2*clock_delta) // ... (10,20), etc. instead of using
clock_delta
object {AlphabetBox_B}
#break
#range (2*clock_delta,3*clock_delta)
object {AlphabetBox_C}
#break
...
#range (25*clock_delta,26*clock_delta) // last range
object {AlphabetBox_Z}
#break
#end
To actually rework the CSG into each letter, instead of creating one of
each, you can use chr() in the text {} object. You'll need to look up that
in Scene Help section 6.1.7 about string functions and check your font
numbering in something like Windows' Character Map (usually found in Start,
Programs, Accessories, System Tools).
> 5) My final question is I have added the following code to your example:
>
> plane {
> y, 0
>
> Why the first created box looks smaller than the others? However, every
box
> looks the same size if the above code is not added.
My boxes weren't adapted for a y plane, they need to start 1 unit upward.
The -1 to 1 size of each box makes them go from -y to +y.
> Sorry for so many questions. If I don't have a good and clear concept, I
> know I can't move on to do anything.
> Hope you can help me!
Well, questions are all a part of it, but a capability to learn the POV-Ray
documentation is still a priority. Hope I have helped.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|