POV-Ray : Newsgroups : povray.binaries.utilities : Cloth simulators Server Time
31 Oct 2024 19:28:15 EDT (-0400)
  Cloth simulators (Message 1 to 3 of 3)  
From: Lars Erik Bryld
Subject: Cloth simulators
Date: 29 Apr 2001 07:41:06
Message: <48vnet8taatd0n972cks7h3rkutav2a8gf@4ax.com>
Hello all.

Posted this at newusers a fortnight ago with no response. Trying
again:


I am fairly new to raytracing, but I have managed to get the Cloth
Animator up and running (version 0.4.0 with MegaPov 0.6a on a NT
system) I am using the sample files for flag animation with a few
modifications. First and foremost, I want to be able to use a bitmap
instead of drawing the flag myself (not all flags are as simple as the
Tricolore), and secondly I only want a modest 10-frame animated GIF,
not a whooping 200-frame mpeg.

In consequence, I have changed the color_map to an image_map in the
scene file and the Final_Frame from 200 to 10 in the ini file.

I have one unexpected side effect: the input.png image appear rotated
180 degrees in the animation. While the workaround is obvious, I'd
prefer if some kind soul can explain to me why it happens.

Also, I'd love to hear which other parameters I ought to change when
only going for 10 rather than 200 frames. (Do I still need 10000
steps, for example?). As of now I seem to get fairly good animations,
though I often get the impression that the wind is blowing from the
opposite direction.

Finally, the generated inc-file seems to be re-usable for additional
renderings. Is there a good reason not to do this?

And to end it all: Any comments on Cloth Simulator vs Clothray?


Thanks in advance

Lars Erik Bryld




> flag.cl:

/*
 * Flag animation sample, to render first run:
 * cloth -i flag.cl -o flag.inc -r flag.raw -s 10000
 *
 * Then uncomment the "read_file" line and run:
 * megapov flag.ini
 */
global_settings {
  step 0.2
  viscosity 0.01
  wind 3*y
}

cloth {
  x_size 15
  y_size 15
  dist 2
  hnoise 0.01
  vnoise 0.01
  shear 2
  damping 0.001
  position { 14.5*z, 30*y, -29*z }
  //read_file "flag.raw"
  
  attach { 0, 0, 14.5*z }
  attach { 0, 1, -14.5*z }
}

> flag.ini

Input_File_Name=flag.pov
Post_Frame_Command=./cloth -i flag.cl -o flag.inc -s 25 -r flag.raw
Display=on
Verbose=on
Preview_Start_Size=4
Final_Frame=10



> flag.pov

#version unofficial MegaPov 0.6;

global_settings {
  assumed_gamma 1.0
}

camera {
  location -100*z+25*y
  look_at 0//-25*y
  angle 40
  rotate -90*y
}

light_source {
  <1000, 1000, -1000>
  rgb 1
}
light_source {
  <-1000, 1000, -1000>
  rgb 0.25
  shadowless
}

object {
  #include "flag.inc"
  uv_mapping
  pigment {
    image_map {
    png "input.png"
              }
           }
}

union {
  cone { -200*y, 1.5, 20*y, 1 }
  sphere { 0, 2 scale <1, 0.5, 1> translate 20*y }
  pigment { color rgb 1 }
  translate -1.5*z
}

Med venlig hilsen

Lars Erik Bryld ( larserik @ dadlnet.dk )



Med venlig hilsen

Lars Erik Bryld ( larserik @ dadlnet.dk )



Post a reply to this message

From: Andy Cocker
Subject: Re: Cloth simulators
Date: 29 Apr 2001 09:21:40
Message: <3aec1564@news.povray.org>
"Lars Erik Bryld" <lar### [at] dadlnetdk> wrote in message
news:48vnet8taatd0n972cks7h3rkutav2a8gf@4ax.com...
> Hello all.
>
> Posted this at newusers a fortnight ago with no response. Trying
> again:

Sorry.. never saw it.

> I am fairly new to raytracing, but I have managed to get the Cloth
> Animator up and running (version 0.4.0 with MegaPov 0.6a on a NT
> system) I am using the sample files for flag animation with a few
> modifications. First and foremost, I want to be able to use a bitmap
> instead of drawing the flag myself (not all flags are as simple as the
> Tricolore), and secondly I only want a modest 10-frame animated GIF,
> not a whooping 200-frame mpeg.
>
> In consequence, I have changed the color_map to an image_map in the
> scene file and the Final_Frame from 200 to 10 in the ini file.
>
> I have one unexpected side effect: the input.png image appear rotated
> 180 degrees in the animation. While the workaround is obvious, I'd
> prefer if some kind soul can explain to me why it happens.

Can't help you there, but I noticed the same thing when using uv_mapping.
Don't understand the inner workings of uv_mapping myself, but found that a
simple rotation worked ok. Never thought anymore about it.

> Also, I'd love to hear which other parameters I ought to change when
> only going for 10 rather than 200 frames. (Do I still need 10000
> steps, for example?). As of now I seem to get fairly good animations,
> though I often get the impression that the wind is blowing from the
> opposite direction.

Well, AFAIK, use as high an initial number of steps as you need (to allow
the flag to become 'settled' - to drop to it's natural position), then just
use small steps from then on between each frame. Something like -s 10 or -s
25, whichever works best. The higher the number, the faster the animation. I
guess this all interacts with wind strength, and damping too.
Your impression that the wind is blowing from the opposite direction must
just be an optical illusion caused by a combination of the above settings I
think.. if the wind truly *were* blowing the other way, the flag would react
accordingly, and move around the attatch points.


> Finally, the generated inc-file seems to be re-usable for additional
> renderings. Is there a good reason not to do this?

In the case of a flag, where start and end positions don't really matter,
then no. However, if your animation starts with the flag 'at rest', and the
wind builds gradually, then you would have to restart the simulation each
time you rendered the anim. Is that clear? I'm not great at explaining
myself.

> And to end it all: Any comments on Cloth Simulator vs Clothray?

Clothray allows the cloth to interact with any declared POV shape (I think I
am correct on this), whereas Cloth Sim uses just a few primitives, and I
don't think you can rotate them directly within the *.cl file. Plus, I
suppose it's more convenient to have everything within the one prog.

Lastly, I noticed you are using a modified version of the flag anim that
came with Cloth Sim. I think that the anim came with Cloth Sim 0.3, and uses
damping 0.001. However, I got the impression that the way damping works
changed when Cloth Sim 0.4.0 came out, so you might want to experiment with
raising this value (maybe as high as 1), I dunno. I could be wrong tho.

Andy


Post a reply to this message

From: Lars Erik Bryld
Subject: Re: Cloth simulators
Date: 30 Apr 2001 14:43:49
Message: <82cretg9po1419p7260mki1b029blhccb7@4ax.com>
On Sun, 29 Apr 2001 14:21:19 +0100, "Andy Cocker"
<big### [at] mariner9fsnetcouk> wrote:

>Don't understand the inner workings of uv_mapping myself, but found that a
>simple rotation worked ok. Never thought anymore about it.

Not going to either then..

>Well, AFAIK, use as high an initial number of steps as you need (to allow
>the flag to become 'settled' - to drop to it's natural position), then just
>use small steps from then on between each frame. Something like -s 10 or -s
>25, whichever works best. The higher the number, the faster the animation. I
>guess this all interacts with wind strength, and damping too.

-s 25 creates very wild movements - at least with damping 0.001, but
I'll experiment further

>In the case of a flag, where start and end positions don't really matter,
>then no. However, if your animation starts with the flag 'at rest', and the
>wind builds gradually, then you would have to restart the simulation each
>time you rendered the anim. Is that clear?

Crystal!

>> And to end it all: Any comments on Cloth Simulator vs Clothray?
>
>Clothray allows the cloth to interact with any declared POV shape (I think I
>am correct on this), whereas Cloth Sim uses just a few primitives, and I
>don't think you can rotate them directly within the *.cl file. Plus, I
>suppose it's more convenient to have everything within the one prog.

Sure - if only I had any idea how the configs in the .cth file works.
If you come across some scene examples I'd love the url. I am
following these groups, of course...

I am inferring that you yourself largely have abandoned ClothSim in
favour of Clothray then. Is that right?

>Lastly, I noticed you are using a modified version of the flag anim that
>came with Cloth Sim. I think that the anim came with Cloth Sim 0.3, and uses
>damping 0.001. However, I got the impression that the way damping works
>changed when Cloth Sim 0.4.0 came out, so you might want to experiment with
>raising this value (maybe as high as 1), I dunno. I could be wrong tho.

Right now I'm at damping 0.05 and lowering (using -s 25)

Thanks for responding :) I have been admiring your work of last month

Med venlig hilsen

Lars Erik Bryld ( larserik @ dadlnet.dk )



Post a reply to this message

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