|
 |
Hello POV-Ray Users!
So, i was rendering an animation of a metronome whose pendulum swings back and
forth between a specific angle and its negative.
Here's how I did it:
#declare maxangle = 35;
#declare actangle = maxangle * sin( clock * 4 ) * cos( clock * 4 );
polygon {
5,
<-.06,0>, <-.06,2.6>, <.06,2.6>, <.06,0>, <-.06,0>
texture{ Chrome_Metal
// normal { bumps 0.5 scale 0.05 }
// finish { phong 1 }
} // end of texture ---------------------------
translate <0,0,0>
rotate <0,0,clock*actangle>
translate <0,.3,-.8>
}
}
object { metronome
scale .5 }
This is not the complete scene, just the pendulum, which is a polygon that
rotates (maxangle value).
(I'm not an experienced user, and I don't know much about trigonometry and stuff
like that, srry.)
However, the pendulum doesn't swing back and forth constantly (as it should);
instead, it moves a very short distance at the beginning of the animation, and
as the animation progresses, the distance it travels increases until it exceeds
the angle that had been set (or so I think) as the maximum.
If anyone knows what's going on and how to fix it, I would really appreciate
it if you could share your knowledge with me.
Thanks!
(sorry if my english is bad, most of this post was translated)
- S I R ?
Post a reply to this message
|
 |
|
 |
"Sir" <fra### [at] jaliscoedu mx> wrote:
> #declare actangle = maxangle * sin( clock * 4 ) * cos( clock * 4 );
> [...]
> rotate <0,0,clock*actangle>
Didn't analyse the full thing but noticed the clock as well in actangle as in
rotate again. So you animate the animation, removing the clock from rotate might
do the trick?
ingo
Post a reply to this message
|
 |
|
 |
"ingo" <nomail@nomail> wrote:
> "Sir" <fra### [at] jaliscoedu mx> wrote:
>
> > #declare actangle = maxangle * sin( clock * 4 ) * cos( clock * 4 );
> > [...]
> > rotate <0,0,clock*actangle>
>
> Didn't analyse the full thing but noticed the clock as well in actangle as in
> rotate again. So you animate the animation, removing the clock from rotate might
> do the trick?
>
> ingo
Also, why is sin getting multiplied by cos?
I would just use cos to oscillate between 1 and -1.
- BE
Post a reply to this message
|
 |
|
 |
On 23/07/2026 06:30, Sir wrote:
>
> Hello POV-Ray Users!
>
> So, i was rendering an animation of a metronome whose pendulum swings back and
> forth between a specific angle and its negative.
>
Hello 'Sir Francisco',
I think you're making things harder on yourself....
For exemple :
// 50 degrees -> +/- 25 deg or something else, of course
#declare Amplitude = 50;
#declare HalfAmplitude = Amplitude*0.50;
Object to animate is "Object"
object {
Object
rotate sin(clock*tau)*HalfAmplitude*z
}
'clock' from 0.0 to 1.0
In this exemple, oscillations is around z-axis.
I hope this helps...
--
kurtz le pirate
compagnie de la banquise
Post a reply to this message
Attachments:
Download 'metronome.mp4.dat' (45 KB)
|
 |