Changeset 446 for experiments
- Timestamp:
- 11/27/15 01:00:43 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
experiments/frams/foraminifera/data/scripts/foraminifera.show
r444 r446 6 6 Nutrients are shown as tiny green cylinders. Foraminifers move towards nearest nutrients and this way they can accumulate enough energy to reproduce. 7 7 8 After "Enhance visualization" option is enabled reticulopodia are shown asdisks and positions of nutrients are indicated by cuboids.8 When the "Enhance visualization" option is enabled, reticulopodia are shown as large disks and positions of nutrients are indicated by cuboids. 9 9 10 10 More information at www.framsticks.com/foraminifera … … 13 13 code:~ 14 14 15 global Params; 15 global Params; //to easily transfer changes in identical properties from this show to expdef 16 global lasttimescale; //to display time scale when it changes significantly 16 17 17 18 function onLoad() 18 19 { 19 20 Simulator.init(); 21 lasttimescale=0; 20 22 GLDisplay.desiredsimspeed = 50; 21 23 GLDisplay.minfps = 10; 22 24 TrackingCam.cam_h = 15; //more side view 25 Params = { "feedrate" : [0.05,0.1,0.2], "feedtrans" : [0.01,0.05,0.1],"energy_nut" :[0.5,1.5,3.0], "stress" : [0,1], "visualize" : [0,1]}; 26 ShowParams.visualize=1; 27 } 23 28 24 Params = { "feedrate" : [0.05,0.1,0.2], "feedtrans" : [0.01,0.05,0.1],"energy_nut" :[0.5,1.5,3.0], "stress" : [0,1], "visualize" : [0,1]}; 29 function timeScale() 30 { 31 //just a draft, this function and all constants in expdef need serious review 32 var foramSpeedMmPerMin=0.1; //0.1 mm/minute based on http://drs.nio.org/drs/bitstream/handle/2264/418/ONGC_Bull_37%281%29_53.pdf 33 var localDriveMicronsPerStep=framsToMicrons(0.08); //0.08 is used in expdef as distance (in frams units) per simulation step 34 var foramSpeedMmPerSec=foramSpeedMmPerMin/60; 35 var localDriveMmPerStep=localDriveMicronsPerStep/1000; 36 var localDriveMmPerSec=localDriveMmPerStep*Simulator.simspeed; 37 return localDriveMmPerSec/foramSpeedMmPerSec; 38 } 39 40 function updateBanner(timescale) 41 { 42 GLDisplay.banner="World size is %g mm." % (framsToMicrons(World.wrldsiz)/1000); 43 GLDisplay.banner+="\nShowing real-time x %g." % timescale; 44 } 45 46 function onShowStep() 47 { 48 var timescale=timeScale(); 49 if (timescale<lasttimescale*0.9 || timescale>lasttimescale*1.1) //significant change 50 { 51 updateBanner(timescale); 52 lasttimescale=timescale; 53 } 25 54 } 26 55
Note: See TracChangeset
for help on using the changeset viewer.