discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Animation

KE
Karl Exler
Thu, Feb 15, 2024 5:07 AM

Dear all,

yesterday  I wanted to use the animation feature for the first time (I
am running OpenScad on Mint)

I used this code from the documentation
$t=10;
rotate ([0, 0, -$t*360])
translate([-50,0,0])
square(25, center=true);

Then I opened "Window / Animation" an entered "60" at FPS and "100" Steps.

And now? Nothing happens, Even, when I click F5 or the "Play-Button"..
What I am doing wrong?

Thanks
Karl

Dear all, yesterday  I wanted to use the animation feature for the first time (I am running OpenScad on Mint) I used this code from the documentation $t=10; rotate ([0, 0, -$t*360]) translate([-50,0,0]) square(25, center=true); Then I opened "Window / Animation" an entered "60" at FPS and "100" Steps. And now? Nothing happens, Even, when I click F5 or the "Play-Button".. What I am doing wrong? Thanks Karl
MM
Michael Marx (spintel)
Thu, Feb 15, 2024 5:14 AM

Get rid of $t=10;
You are overriding the $t set by animation.
Where was that documentation?

-----Original Message-----
From: Karl Exler via Discuss [mailto:discuss@lists.openscad.org]
Sent: Thu, 15 Feb 2024 16:08
To: fred via Discuss
Cc: Karl Exler
Subject: [OpenSCAD] Animation

Dear all,

yesterday  I wanted to use the animation feature for the first time (I
am running OpenScad on Mint)

I used this code from the documentation
$t=10;
rotate ([0, 0, -$t*360])
translate([-50,0,0])
square(25, center=true);

Then I opened "Window / Animation" an entered "60" at FPS and "100" Steps.

And now? Nothing happens, Even, when I click F5 or the "Play-Button"..
What I am doing wrong?

Thanks
Karl


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Get rid of $t=10; You are overriding the $t set by animation. Where was that documentation? > -----Original Message----- > From: Karl Exler via Discuss [mailto:discuss@lists.openscad.org] > Sent: Thu, 15 Feb 2024 16:08 > To: fred via Discuss > Cc: Karl Exler > Subject: [OpenSCAD] Animation > > Dear all, > > yesterday I wanted to use the animation feature for the first time (I > am running OpenScad on Mint) > > I used this code from the documentation > $t=10; > rotate ([0, 0, -$t*360]) > translate([-50,0,0]) > square(25, center=true); > > Then I opened "Window / Animation" an entered "60" at FPS and "100" Steps. > > And now? Nothing happens, Even, when I click F5 or the "Play-Button".. > What I am doing wrong? > > Thanks > Karl > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
KE
Karl Exler
Thu, Feb 15, 2024 9:06 AM

ah.. YES ---> thank you very much. another black box has opened ;-)

And If I want to "forward" someone this as movie I use ffmpeg, something
like "ffmpeg -framerate 1 -pattern_type glob -i 'frame*.png'
output.mp4". OK?
There is no way, that OSCAD outputs a ready animation??

I found the wrong (probably outdated) explanation on Youtube -->
https://www.youtube.com/watch?v=bIdgSTPgeVA

Thanks to the best community all over the world

Karl

P.S.
In this YT movie "he" animates his object in more than one direction for
several times... This is not really necessary for my purposes.. but in
deed it looks sexy. So one more question: Is there a second way for
"animation by coding" (using this $t variable)????

Am 15.02.24 um 06:14 schrieb Michael Marx (spintel) via Discuss:

Get rid of $t=10;
You are overriding the $t set by animation.
Where was that documentation?

-----Original Message-----
From: Karl Exler via Discuss [mailto:discuss@lists.openscad.org]
Sent: Thu, 15 Feb 2024 16:08
To: fred via Discuss
Cc: Karl Exler
Subject: [OpenSCAD] Animation

Dear all,

yesterday  I wanted to use the animation feature for the first time (I
am running OpenScad on Mint)

I used this code from the documentation
$t=10;
rotate ([0, 0, -$t*360])
translate([-50,0,0])
square(25, center=true);

Then I opened "Window / Animation" an entered "60" at FPS and "100" Steps.

And now? Nothing happens, Even, when I click F5 or the "Play-Button"..
What I am doing wrong?

Thanks
Karl


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

ah.. YES ---> thank you very much. another black box has opened ;-) And If I want to "forward" someone this as movie I use ffmpeg, something like "ffmpeg -framerate 1 -pattern_type glob -i 'frame*.png' output.mp4". OK? There is no way, that OSCAD outputs a ready animation?? I found the wrong (probably outdated) explanation on Youtube --> https://www.youtube.com/watch?v=bIdgSTPgeVA Thanks to the best community all over the world Karl P.S. In this YT movie "he" animates his object in more than one direction for several times... This is not really necessary for my purposes.. but in deed it looks sexy. So one more question: Is there a second way for "animation by coding" (using this $t variable)???? Am 15.02.24 um 06:14 schrieb Michael Marx (spintel) via Discuss: > Get rid of $t=10; > You are overriding the $t set by animation. > Where was that documentation? > >> -----Original Message----- >> From: Karl Exler via Discuss [mailto:discuss@lists.openscad.org] >> Sent: Thu, 15 Feb 2024 16:08 >> To: fred via Discuss >> Cc: Karl Exler >> Subject: [OpenSCAD] Animation >> >> Dear all, >> >> yesterday I wanted to use the animation feature for the first time (I >> am running OpenScad on Mint) >> >> I used this code from the documentation >> $t=10; >> rotate ([0, 0, -$t*360]) >> translate([-50,0,0]) >> square(25, center=true); >> >> Then I opened "Window / Animation" an entered "60" at FPS and "100" Steps. >> >> And now? Nothing happens, Even, when I click F5 or the "Play-Button".. >> What I am doing wrong? >> >> Thanks >> Karl >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Rogier Wolff
Thu, Feb 15, 2024 12:03 PM

On Thu, Feb 15, 2024 at 10:06:19AM +0100, Karl Exler via Discuss wrote:

ah.. YES ---> thank you very much. another black box has opened ;-)

And If I want to "forward" someone this as movie I use ffmpeg, something
like "ffmpeg -framerate 1 -pattern_type glob -i 'frame*.png' output.mp4".

If I remember the ffmpeg commandline correctly, you're setting the
framerate for the displayed movie to 1fps. That's a bit slow for an
animation. For "preview" this might be OK, but for the real deal I'd
generate way more images with openscad and use a "normal" framerate like
25 or 30.

For a low quality quick proof-of-concept you might go as low as 2 or 5
fps.

Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Thu, Feb 15, 2024 at 10:06:19AM +0100, Karl Exler via Discuss wrote: > ah.. YES ---> thank you very much. another black box has opened ;-) > > And If I want to "forward" someone this as movie I use ffmpeg, something > like "ffmpeg -framerate 1 -pattern_type glob -i 'frame*.png' output.mp4". If I remember the ffmpeg commandline correctly, you're setting the framerate for the displayed movie to 1fps. That's a bit slow for an animation. For "preview" this might be OK, but for the real deal I'd generate way more images with openscad and use a "normal" framerate like 25 or 30. For a low quality quick proof-of-concept you might go as low as 2 or 5 fps. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
JB
Jordan Brown
Thu, Feb 15, 2024 5:01 PM

On 2/15/2024 1:06 AM, Karl Exler via Discuss wrote:

And If I want to "forward" someone this as movie I use ffmpeg,
something like "ffmpeg -framerate 1 -pattern_type glob -i 'frame*.png'
output.mp4". OK?

I use (snippet from shell script, full script attached)

magick convert "$outdir/$out"*.png -set delay 1x$fps "$out.gif"

to create an animated GIF, and

img2webp             \
    -v               \
    -loop 0          \
    -d $ms_per_frame \
    -lossy           \
    -q $compression  \
    -m 4             \
    -o "$out.webp"   \
    "$outdir/$out"*.png

to create a WEBP.  $compression is 0-100, with 100 being highest quality.

There is no way, that OSCAD outputs a ready animation??

In this YT movie "he" animates his object in more than one direction
for several times... This is not really necessary for my purposes..
but in deed it looks sexy. So one more question: Is there a second way
for "animation by coding" (using this $t variable)????

$t is it.  $t is the clock that ticks through your animation.  It's up
to you what happens as it ticks.

There are innumerable techniques for how to turn $t values into changes
in your model.  One pretty general technique is to use have a table of
times and parameter values, and use lookup() to interpolate a current
value - whether that value is a position, rotation, scale, camera
position, et cetera.  See
https://files.openscad.org/advent-calendar-2023/PorchPirate/Porch%20Pirate.scad
for some examples.

On 2/15/2024 1:06 AM, Karl Exler via Discuss wrote: > And If I want to "forward" someone this as movie I use ffmpeg, > something like "ffmpeg -framerate 1 -pattern_type glob -i 'frame*.png' > output.mp4". OK? I use (snippet from shell script, full script attached) magick convert "$outdir/$out"*.png -set delay 1x$fps "$out.gif" to create an animated GIF, and img2webp \ -v \ -loop 0 \ -d $ms_per_frame \ -lossy \ -q $compression \ -m 4 \ -o "$out.webp" \ "$outdir/$out"*.png to create a WEBP.  $compression is 0-100, with 100 being highest quality. > There is no way, that OSCAD outputs a ready animation?? Correct.  See issue #891 <https://github.com/openscad/openscad/issues/891>. > In this YT movie "he" animates his object in more than one direction > for several times... This is not really necessary for my purposes.. > but in deed it looks sexy. So one more question: Is there a second way > for "animation by coding" (using this $t variable)???? $t is it.  $t is the clock that ticks through your animation.  It's up to you what happens as it ticks. There are innumerable techniques for how to turn $t values into changes in your model.  One pretty general technique is to use have a table of times and parameter values, and use lookup() to interpolate a current value - whether that value is a position, rotation, scale, camera position, et cetera.  See https://files.openscad.org/advent-calendar-2023/PorchPirate/Porch%20Pirate.scad for some examples.