#NEWLINE# def __init__( self , c = [ 0.0 , 0.0 , 0.0 ] , h = 1.0 , r = 1.0 , divisions = 20 , min_lng_deg = 0 , max_lng_deg = 360 ) : #NEWLINE# #INDENT# positions = [ ] #NEWLINE# normals = [ ] #NEWLINE# texture_positions = [ ] #NEWLINE# indices = [ ] #NEWLINE# min_lng = ( ( min_lng_deg * math . pi ) / 180 ) #NEWLINE# max_lng = ( ( max_lng_deg * math . pi ) / 180 ) #NEWLINE# lng_step = ( ( max_lng - r ) / divisions ) #NEWLINE# for i in range ( divisions ) : #NEWLINE# #INDENT# a = ( min_lng + ( i * lng_step ) ) #NEWLINE# positions += [ ( ( ( r * math . sin ( a ) ) + c [ 0 ] ) , c [ 1 ] , ( ( r * math . cos ( a ) ) + c [ 2 ] ) ) ] #NEWLINE# normals += [ ( math . sin ( a ) , 0 , math . cos ( a ) ) ] #NEWLINE# texture_positions += [ ( ( float ( i ) / divisions ) , 0.0 ) ] #NEWLINE# #UNINDENT# for i in range ( divisions ) : #NEWLINE# #INDENT# a = ( min_lng + ( i * lng_step ) ) #NEWLINE# positions += [ ( ( ( r * math . sin ( a ) ) + c [ 0 ] ) , ( h + c [ 1 ] ) , ( ( r * math . cos ( a ) ) + c [ 2 ] ) ) ] #NEWLINE# normals += [ ( math . sin ( a ) , 0 , math . cos ( a ) ) ] #NEWLINE# texture_positions += [ ( ( float ( i ) / divisions ) , 1.0 ) ] #NEWLINE# #UNINDENT# for x0 in range ( divisions ) : #NEWLINE# #INDENT# x1 = ( ( x0 + 1 ) % divisions ) #NEWLINE# indices += [ x0 , x1 , ( x0 + divisions ) , x1 , ( x1 + divisions ) , ( x0 + divisions ) ] #NEWLINE# #UNINDENT# self . positions = positions #NEWLINE# self . normals = normals #NEWLINE# self . texture_positions = texture_positions #NEWLINE# self . indices = indices