#NEWLINE# def get_earthmesh( trans , rotation ) : #NEWLINE# #INDENT# from serialization import load_mesh #NEWLINE# from copy import deepcopy #NEWLINE# if ( not hasattr ( get_earthmesh , 'm' ) ) : #NEWLINE# #INDENT# def wg( url ) : #NEWLINE# #INDENT# dest = join ( '/tmp' , split ( url ) [ 1 ] ) #NEWLINE# if ( not exists ( dest ) ) : #NEWLINE# #INDENT# wget ( url , dest ) #NEWLINE# #UNINDENT# #UNINDENT# wg ( 'http://files.is.tue.mpg.de/mloper/opendr/images/nasa_earth.obj' ) #NEWLINE# wg ( 'http://files.is.tue.mpg.de/mloper/opendr/images/nasa_earth.mtl' ) #NEWLINE# wg ( 'http://files.is.tue.mpg.de/mloper/opendr/images/nasa_earth.jpg' ) #NEWLINE# fname = join ( '/tmp' , 'nasa_earth.obj' ) #NEWLINE# mesh = load_mesh ( fname ) #NEWLINE# mesh . v = np . asarray ( mesh . v , order = 'C' ) #NEWLINE# mesh . vc = ( ( mesh . v * 0 ) + 1 ) #NEWLINE# mesh . v -= row ( np . mean ( mesh . v , axis = 0 ) ) #NEWLINE# mesh . v /= np . max ( mesh . v ) #NEWLINE# mesh . v *= 2.0 #NEWLINE# get_earthmesh . mesh = rotation #NEWLINE# #UNINDENT# mesh = deepcopy ( get_earthmesh . mesh ) #NEWLINE# mesh . v = mesh . v . dot ( cv2 . Rodrigues ( np . asarray ( np . array ( rotation ) , np . float64 ) ) [ 0 ] ) #NEWLINE# mesh . v = ( mesh . v + row ( np . asarray ( trans ) ) ) #NEWLINE# return mesh