# -*- coding: utf-8 -*-
import vaex.dataset as dataset
import numpy as np
import numpy
import math
import vaex.utils
import matplotlib.pyplot as plt
import scipy.ndimage
import matplotlib.animation as animation
import matplotlib
import time



def rotz(angle):
	matrix = np.identity(4)
	matrix[0,0] = np.cos(angle)
	matrix[0,1] = np.sin(angle)
	matrix[1,0] = -np.sin(angle)
	matrix[1,1] = np.cos(angle)
	return np.matrix(matrix).T

def rotx(angle):
	matrix = np.identity(4)
	matrix[1,1] = np.cos(angle)
	matrix[1,2] = np.sin(angle)
	matrix[2,1] = -np.sin(angle)
	matrix[2,2] = np.cos(angle)
	return np.matrix(matrix).T

def scale(factor):
	matrix = np.identity(4)
	for i in range(3):
		matrix[i,i] = float(factor)
	return np.matrix(matrix).T

def translate(x,y,z):
	matrix = np.identity(4)
	matrix[3,0:3] = x, y, z
	return np.matrix(matrix).T
	
def proj(size):
	matrix = np.identity(4)
	#return np.matrix(matrix).T
	right = float(size)
	left = 0
	top = float(N)
	bottom = 0
	far = 1.
	near = 0
	print 
	
	matrix[0][0] = 2./(right-left)
	matrix[1][1] = 2./(top-bottom)