Home » Archimedes archive » Acorn User » AU 1994-02.adf » !FEMS_App_FEMS_App » sims/cloth/ClothSpher

sims/cloth/ClothSpher

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1994-02.adf » !FEMS_App_FEMS_App
Filename: sims/cloth/ClothSpher
Read OK:
File size: 05C2 bytes
Load address: 0000
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
FEMS2
/* simulation definition file to drop a cloth on a sphere */

/* select output style */
rendering {
 type dots             /* draw scene with dots: "lines" takes more memory */
 resolution 320,256    /* use a 320 x 256 pixel screen mode */
 view -30,24           /* viewpoint: x-y rotation, elevation in degrees */
}

/* simulation parameters */
frame_aim 640          /* pause after 640 frames */
gravity 0,0,-600       /* set direction and strength of gravity */
time_div 1             /* time step division: 1 is fastest, larger values
                          (use 2,4,8, etc.) make objects stiffer */

/* create the cloth */
solid {   
 /* first create the object... */
 create {
  type sheet
  points 21            /* 21 points on each side, making 20 x 20 squares */
  size 16.3in          /* this sets the size of the cloth */
 }
 /* ...then join the points together */
 nearbonds {
  spring_const 51      /* this sets the strength of the springs */
  range 2.1            /* connect all points within 2.1 times the side
                          length of the squares */
 }
 damping 3
 translate 0,0,6.9in   /* move the cloth up */
}

/* create the sphere */
background {
 create {
  type sphere
  points 12            /* this sets the number of points used to draw the
                          sphere: 12 means 24 round the circumference */
  size 3.3in           /* this is the radius of the sphere */
 }
 translate 0,0,3.3in   /* move the sphere up */
}
00000000  46 45 4d 53 32 0a 2f 2a  20 73 69 6d 75 6c 61 74  |FEMS2./* simulat|
00000010  69 6f 6e 20 64 65 66 69  6e 69 74 69 6f 6e 20 66  |ion definition f|
00000020  69 6c 65 20 74 6f 20 64  72 6f 70 20 61 20 63 6c  |ile to drop a cl|
00000030  6f 74 68 20 6f 6e 20 61  20 73 70 68 65 72 65 20  |oth on a sphere |
00000040  2a 2f 0a 0a 2f 2a 20 73  65 6c 65 63 74 20 6f 75  |*/../* select ou|
00000050  74 70 75 74 20 73 74 79  6c 65 20 2a 2f 0a 72 65  |tput style */.re|
00000060  6e 64 65 72 69 6e 67 20  7b 0a 20 74 79 70 65 20  |ndering {. type |
00000070  64 6f 74 73 20 20 20 20  20 20 20 20 20 20 20 20  |dots            |
00000080  20 2f 2a 20 64 72 61 77  20 73 63 65 6e 65 20 77  | /* draw scene w|
00000090  69 74 68 20 64 6f 74 73  3a 20 22 6c 69 6e 65 73  |ith dots: "lines|
000000a0  22 20 74 61 6b 65 73 20  6d 6f 72 65 20 6d 65 6d  |" takes more mem|
000000b0  6f 72 79 20 2a 2f 0a 20  72 65 73 6f 6c 75 74 69  |ory */. resoluti|
000000c0  6f 6e 20 33 32 30 2c 32  35 36 20 20 20 20 2f 2a  |on 320,256    /*|
000000d0  20 75 73 65 20 61 20 33  32 30 20 78 20 32 35 36  | use a 320 x 256|
000000e0  20 70 69 78 65 6c 20 73  63 72 65 65 6e 20 6d 6f  | pixel screen mo|
000000f0  64 65 20 2a 2f 0a 20 76  69 65 77 20 2d 33 30 2c  |de */. view -30,|
00000100  32 34 20 20 20 20 20 20  20 20 20 20 20 2f 2a 20  |24           /* |
00000110  76 69 65 77 70 6f 69 6e  74 3a 20 78 2d 79 20 72  |viewpoint: x-y r|
00000120  6f 74 61 74 69 6f 6e 2c  20 65 6c 65 76 61 74 69  |otation, elevati|
00000130  6f 6e 20 69 6e 20 64 65  67 72 65 65 73 20 2a 2f  |on in degrees */|
00000140  0a 7d 0a 0a 2f 2a 20 73  69 6d 75 6c 61 74 69 6f  |.}../* simulatio|
00000150  6e 20 70 61 72 61 6d 65  74 65 72 73 20 2a 2f 0a  |n parameters */.|
00000160  66 72 61 6d 65 5f 61 69  6d 20 36 34 30 20 20 20  |frame_aim 640   |
00000170  20 20 20 20 20 20 20 2f  2a 20 70 61 75 73 65 20  |       /* pause |
00000180  61 66 74 65 72 20 36 34  30 20 66 72 61 6d 65 73  |after 640 frames|
00000190  20 2a 2f 0a 67 72 61 76  69 74 79 20 30 2c 30 2c  | */.gravity 0,0,|
000001a0  2d 36 30 30 20 20 20 20  20 20 20 2f 2a 20 73 65  |-600       /* se|
000001b0  74 20 64 69 72 65 63 74  69 6f 6e 20 61 6e 64 20  |t direction and |
000001c0  73 74 72 65 6e 67 74 68  20 6f 66 20 67 72 61 76  |strength of grav|
000001d0  69 74 79 20 2a 2f 0a 74  69 6d 65 5f 64 69 76 20  |ity */.time_div |
000001e0  31 20 20 20 20 20 20 20  20 20 20 20 20 20 2f 2a  |1             /*|
000001f0  20 74 69 6d 65 20 73 74  65 70 20 64 69 76 69 73  | time step divis|
00000200  69 6f 6e 3a 20 31 20 69  73 20 66 61 73 74 65 73  |ion: 1 is fastes|
00000210  74 2c 20 6c 61 72 67 65  72 20 76 61 6c 75 65 73  |t, larger values|
00000220  0a 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |.               |
00000230  20 20 20 20 20 20 20 20  20 20 20 28 75 73 65 20  |           (use |
00000240  32 2c 34 2c 38 2c 20 65  74 63 2e 29 20 6d 61 6b  |2,4,8, etc.) mak|
00000250  65 20 6f 62 6a 65 63 74  73 20 73 74 69 66 66 65  |e objects stiffe|
00000260  72 20 2a 2f 0a 0a 2f 2a  20 63 72 65 61 74 65 20  |r */../* create |
00000270  74 68 65 20 63 6c 6f 74  68 20 2a 2f 0a 73 6f 6c  |the cloth */.sol|
00000280  69 64 20 7b 20 20 20 0a  20 2f 2a 20 66 69 72 73  |id {   . /* firs|
00000290  74 20 63 72 65 61 74 65  20 74 68 65 20 6f 62 6a  |t create the obj|
000002a0  65 63 74 2e 2e 2e 20 2a  2f 0a 20 63 72 65 61 74  |ect... */. creat|
000002b0  65 20 7b 0a 20 20 74 79  70 65 20 73 68 65 65 74  |e {.  type sheet|
000002c0  0a 20 20 70 6f 69 6e 74  73 20 32 31 20 20 20 20  |.  points 21    |
000002d0  20 20 20 20 20 20 20 20  2f 2a 20 32 31 20 70 6f  |        /* 21 po|
000002e0  69 6e 74 73 20 6f 6e 20  65 61 63 68 20 73 69 64  |ints on each sid|
000002f0  65 2c 20 6d 61 6b 69 6e  67 20 32 30 20 78 20 32  |e, making 20 x 2|
00000300  30 20 73 71 75 61 72 65  73 20 2a 2f 0a 20 20 73  |0 squares */.  s|
00000310  69 7a 65 20 31 36 2e 33  69 6e 20 20 20 20 20 20  |ize 16.3in      |
00000320  20 20 20 20 2f 2a 20 74  68 69 73 20 73 65 74 73  |    /* this sets|
00000330  20 74 68 65 20 73 69 7a  65 20 6f 66 20 74 68 65  | the size of the|
00000340  20 63 6c 6f 74 68 20 2a  2f 0a 20 7d 0a 20 2f 2a  | cloth */. }. /*|
00000350  20 2e 2e 2e 74 68 65 6e  20 6a 6f 69 6e 20 74 68  | ...then join th|
00000360  65 20 70 6f 69 6e 74 73  20 74 6f 67 65 74 68 65  |e points togethe|
00000370  72 20 2a 2f 0a 20 6e 65  61 72 62 6f 6e 64 73 20  |r */. nearbonds |
00000380  7b 0a 20 20 73 70 72 69  6e 67 5f 63 6f 6e 73 74  |{.  spring_const|
00000390  20 35 31 20 20 20 20 20  20 2f 2a 20 74 68 69 73  | 51      /* this|
000003a0  20 73 65 74 73 20 74 68  65 20 73 74 72 65 6e 67  | sets the streng|
000003b0  74 68 20 6f 66 20 74 68  65 20 73 70 72 69 6e 67  |th of the spring|
000003c0  73 20 2a 2f 0a 20 20 72  61 6e 67 65 20 32 2e 31  |s */.  range 2.1|
000003d0  20 20 20 20 20 20 20 20  20 20 20 20 2f 2a 20 63  |            /* c|
000003e0  6f 6e 6e 65 63 74 20 61  6c 6c 20 70 6f 69 6e 74  |onnect all point|
000003f0  73 20 77 69 74 68 69 6e  20 32 2e 31 20 74 69 6d  |s within 2.1 tim|
00000400  65 73 20 74 68 65 20 73  69 64 65 0a 20 20 20 20  |es the side.    |
00000410  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000420  20 20 20 20 20 20 6c 65  6e 67 74 68 20 6f 66 20  |      length of |
00000430  74 68 65 20 73 71 75 61  72 65 73 20 2a 2f 0a 20  |the squares */. |
00000440  7d 0a 20 64 61 6d 70 69  6e 67 20 33 0a 20 74 72  |}. damping 3. tr|
00000450  61 6e 73 6c 61 74 65 20  30 2c 30 2c 36 2e 39 69  |anslate 0,0,6.9i|
00000460  6e 20 20 20 2f 2a 20 6d  6f 76 65 20 74 68 65 20  |n   /* move the |
00000470  63 6c 6f 74 68 20 75 70  20 2a 2f 0a 7d 0a 0a 2f  |cloth up */.}../|
00000480  2a 20 63 72 65 61 74 65  20 74 68 65 20 73 70 68  |* create the sph|
00000490  65 72 65 20 2a 2f 0a 62  61 63 6b 67 72 6f 75 6e  |ere */.backgroun|
000004a0  64 20 7b 0a 20 63 72 65  61 74 65 20 7b 0a 20 20  |d {. create {.  |
000004b0  74 79 70 65 20 73 70 68  65 72 65 0a 20 20 70 6f  |type sphere.  po|
000004c0  69 6e 74 73 20 31 32 20  20 20 20 20 20 20 20 20  |ints 12         |
000004d0  20 20 20 2f 2a 20 74 68  69 73 20 73 65 74 73 20  |   /* this sets |
000004e0  74 68 65 20 6e 75 6d 62  65 72 20 6f 66 20 70 6f  |the number of po|
000004f0  69 6e 74 73 20 75 73 65  64 20 74 6f 20 64 72 61  |ints used to dra|
00000500  77 20 74 68 65 0a 20 20  20 20 20 20 20 20 20 20  |w the.          |
00000510  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000520  73 70 68 65 72 65 3a 20  31 32 20 6d 65 61 6e 73  |sphere: 12 means|
00000530  20 32 34 20 72 6f 75 6e  64 20 74 68 65 20 63 69  | 24 round the ci|
00000540  72 63 75 6d 66 65 72 65  6e 63 65 20 2a 2f 0a 20  |rcumference */. |
00000550  20 73 69 7a 65 20 33 2e  33 69 6e 20 20 20 20 20  | size 3.3in     |
00000560  20 20 20 20 20 20 2f 2a  20 74 68 69 73 20 69 73  |      /* this is|
00000570  20 74 68 65 20 72 61 64  69 75 73 20 6f 66 20 74  | the radius of t|
00000580  68 65 20 73 70 68 65 72  65 20 2a 2f 0a 20 7d 0a  |he sphere */. }.|
00000590  20 74 72 61 6e 73 6c 61  74 65 20 30 2c 30 2c 33  | translate 0,0,3|
000005a0  2e 33 69 6e 20 20 20 2f  2a 20 6d 6f 76 65 20 74  |.3in   /* move t|
000005b0  68 65 20 73 70 68 65 72  65 20 75 70 20 2a 2f 0a  |he sphere up */.|
000005c0  7d 0a                                             |}.|
000005c2