POV-Ray : Newsgroups : povray.unofficial.patches : Re: Newbie stupid question : Re: Newbie stupid question Server Time
3 Jul 2024 05:33:25 EDT (-0400)
  Re: Newbie stupid question  
From: Philippe Gibone
Date: 31 Jan 2003 16:37:15
Message: <3e3aec8b@news.povray.org>
Hi Christoph

Thanks for your time, here it is

<Source>
#version unofficial megapov 1.0;

#include "D:\Ray Tracing\MegaPov\include\mechsim.inc"

global_settings {
  assumed_gamma 1.0

  mechsim {
    gravity <0, 0, -9.81>
    method 1

    collision
    {
     1, 0
     stiffness 60000
     damping 3000
    }
    environment {
//      object plane {  z, 0}
      stiffness 60000
      damping 10000
      friction 0.1, 1.001
      method 2
    }


    #if (clock_on)
      step_count 3000
      time_step (1/30)/3000

      topology {
        load_file "tut04.dat"
        save_file "tut04.dat"
      }
    #else
      step_count 0

      topology {
        mass { <    0, 0.0, 2.4>, <0, 0, 0>, 0.1 density 5000 fixed on }
        mass { <-0.30, 0.0, 2.4>, <0, 0, 0>, 0.1 density 5000 fixed on }
        mass { <-0.70, 0.0, 2.4>, <0, 0, 0>, 0.1 density 5000 fixed on }
        mass { <-1.10, 0.0, 2.4>, <0, 0, 0>, 0.1 density 5000 fixed on }
        mass { <-1.50, 0.0, 2.4>, <0, 0, 0>, 0.1 density 5000 fixed on }
        mass { < 1.40, 0.0, 2.4>, <0, 0, 0>, 0.2 density 5000  }
        mass { <-0.30, 0.0, 1.0>, <0, 0, 0>, 0.2 density 5000  }
        mass { <-0.70, 0.0, 1.0>, <0, 0, 0>, 0.2 density 5000  }
        mass { <-1.10, 0.0, 1.0>, <0, 0, 0>, 0.2 density 5000  }
        mass { <-1.50, 0.0, 1.0>, <0, 0, 0>, 0.2 density 5000  }
        connection { 0, 5 stiffness 150000 damping 2000 }
        connection { 1, 6 stiffness 150000 damping 2000 }
        connection { 2, 7 stiffness 150000 damping 2000 }
        connection { 3, 8 stiffness 150000 damping 2000 }
        connection { 4, 9 stiffness 150000 damping 2000 }
        save_file "tut04.dat"
      }
    #end
  }
}

// ----------------------------------------

camera {
  location  <-0.10, -16.0, 1.7>*0.6
  up z
  sky z
  look_at   <0.0, 0.0, 0.7>
  angle 30
}

light_source {
  <2000, -3000, 2700>
  color rgb <1.7, 1.5, 1.2>
}

sky_sphere {
  pigment {
    gradient z
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.2 rgb <0.2,0.3,0.9>]
    }
  }
}

// ----------------------------------------

#declare T_Env=
  texture {
    pigment { color rgb 1.5 }
    finish { ambient 0.05 diffuse 0.6 }
  }


plane {
  z, 0
  texture { T_Env }
}

// ----------------------------------------

MechSim_Show_All_Objects(-1, false, -1, "")

</Source>


Post a reply to this message

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