def _trans_from_params(param_info, params):
 (do_rotate, do_translate, do_scale) = param_info
 i = 0
 trans = []
 if do_rotate:
  (x, y, z) = params[:3]
  trans.append(rotation(x, y, z))
  i += 3
 if do_translate:
  (x, y, z) = params[i:(i + 3)]
  trans.insert(0, translation(x, y, z))
  i += 3
 if (do_scale == 1):
  s = params[i]
  trans.append(scaling(s, s, s))
 elif (do_scale == 3):
  (x, y, z) = params[i:(i + 3)]
  trans.append(scaling(x, y, z))
 trans = reduce(dot, trans)
 return trans

def _trans_from_params ( param_info , params ) : ( do_rotate , do_translate , do_scale ) = param_info i = 0 trans = [ ] if do_rotate : ( x , y , z ) = params [ : 3 ] trans . append ( rotation ( x , y , z ) ) i += 3 if do_translate : ( x , y , z ) = params [ i : ( i + 3 ) ] trans . insert ( 0 , translation ( x , y , z ) ) i += 3 if ( do_scale == 1 ) : s = params [ i ] trans . append ( scaling ( s , s , s ) ) elif ( do_scale == 3 ) : ( x , y , z ) = params [ i : ( i + 3 ) ] trans . append ( scaling ( x , y , z ) ) trans = reduce ( dot , trans ) return trans
convert transformation parameters into a transformation matrix .