POV-Ray : Newsgroups : povray.newusers : Doing flags with Cloth Animator Server Time
13 Nov 2024 03:49:38 EST (-0500)
  Doing flags with Cloth Animator (Message 1 to 1 of 1)  
From: Lars Erik Bryld
Subject: Doing flags with Cloth Animator
Date: 8 Apr 2001 07:27:04
Message: <k8h0dtk38r095l0t4hcr9kplibs60begg8@4ax.com>
Hello all.

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?


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 )



Post a reply to this message

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