In [2]:
import camera
from PIL import Image
from numpy import *
from pylab import *
import numpy as np
In [22]:
points = loadtxt('house.p3d').T
points = vstack((points, ones(points.shape[1])))
In [32]:
r = 0.05*np.random.rand(3)
rot = camera.rotation_matrix(r)
In [33]:
P = hstack((eye(3), array([[0],[0],[-10]])))
cam = camera.Camera(P)
x = cam.project(points)
figure()
plot(x[0], x[1], 'k.')
show()
figure()
for t in range(20):
cam.P = dot(cam.P, rot)
x = cam.project(points)
plot(x[0], x[1], 'k.')
show()
In [34]:
P = hstack((eye(3), array([[0],[0],[-10]])))
cam = camera.Camera(P)
p = points.copy()
figure()
for t in range(20):
p = dot(rot, p)
x = cam.project(p)
plot(x[0], x[1], 'k.')
show()
In [ ]: