Exemplo n.º 1
0
 def draw():
     conn_draw() 
Exemplo n.º 2
0
#!/usr/bin/env python

import model
from math import log, pi, tan
from connection import height, row, numLEDs, draw as conn_draw, pixels
import operator
from utils import get_angles
from morph import color_transition

mod = model.Model('sphere_10.json')
mod.clear()
conn_draw()

class Mercator:
    ''' Mercator works different from normal shaders. We don't want to look up 
        for each x,y,z triple what the value is from the x-y map. That won't 
        fill the sphere correclty. 
        That is, however, how the shaders work. We need the inverse of that. We 
        want to go through each point on the map and map it to the globe! Hence
        not using the shader approach. '''

    pixel_xy = [ (0,0) ] * numLEDs
    image = []
    maxx = 43           # starting at 0
    maxy = 22 
    pixel_xy2 = [[ 0 
          for c in range(maxy+1)] 
          for r in range(maxx+1)]

    ''' From: https://github.com/mbostock/d3/blob/master/src/geo/mercator.js