height the height of the scalar bar.
height= Set the height of the scalar bar.
/* * Define some parameters */ string new: `scalar_bar_title'="Title"; scalar new: `scalar_bar_height'=1.0; scalar new: `scalar_bar_width'=0.25; vector new: `scalar_bar_range'=(0,1); scalar new: `scalar_bar_title_spacing'=10;
scalar new: `tmp_scl'; scalar new: `tmp_scl2'; string new: `tmp_str'; string new: `tmp_str2';
/*
* the hershey_text models */ hershey_text new: ht_title_model text=scalar_bar_title font="futura.m" ; hershey_text new: ht_label_model font="futura.l" ;
/* * compute the labels */ loop new: label_loop duration=scalar_bar_title_spacing resolution=1 start_actions=` tmp_str =""; tmp_str2 float_format=`0.00'; tmp_scl = [scalar_bar_range @ 2 ?] - [scalar_bar_range @ 1 ?]; tmp_scl / scalar_bar_title_spacing;' tick_actions=` tmp_scl2 = tmp_scl * [label_loop time?] + [scalar_bar_range @ 1 ?]; tmp_str2 = tmp_scl2; tmp_str + tmp_str2 + `\n';' end_actions=`tmp_str chop! chop!;' ; label_loop start!;
ht_label_model text=tmp_str ;
/* * now the scalar bar */ scalar_bar new: scalar_bar_model height=scalar_bar_height width=scalar_bar_width ;
actor new: the_scalar_bar_title modeller=ht_title_model; the_scalar_bar_title position=(0,scalar_bar_height,0); tmp_scl = scalar_bar_height * 0.1; the_scalar_bar_title scale=(tmp_scl, tmp_scl, 1.0);
actor new: the_scalar_bar_label modeller=ht_label_model; tmp_scl = scalar_bar_width * 1.1; the_scalar_bar_label position=(tmp_scl,0,0); tmp_scl = scalar_bar_height / scalar_bar_title_spacing; the_scalar_bar_label scale=(tmp_scl, tmp_scl, 1.0);
actor new: the_scalar_bar modeller=scalar_bar_model ;
camera new: acam position=(0,0,1) range=[scalar_bar_model bounds?] default! on! ; renderer new: aren actors= (the_scalar_bar, [actor instances?]) cameras= acam render! ;