summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony LaTorre <devnull@localhost>2012-11-09 13:59:07 -0600
committertlatorre <tlatorre@uchicago.edu>2021-05-09 08:42:39 -0700
commit537f219f27a6174e33e18418dd7fc27869d4a8c4 (patch)
tree803d5c48d0dde1bfd8dc7b5cfc7b03148f392005
parent3b75a69b6e7cca45cd8616366559bf210ff6c554 (diff)
downloadchroma-537f219f27a6174e33e18418dd7fc27869d4a8c4.tar.gz
chroma-537f219f27a6174e33e18418dd7fc27869d4a8c4.tar.bz2
chroma-537f219f27a6174e33e18418dd7fc27869d4a8c4.zip
positions returned by from_film() should be located at the focal point, not the actual pixel locations
-rw-r--r--chroma/project.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/chroma/project.py b/chroma/project.py
index 05e4d2e..2d38a9e 100644
--- a/chroma/project.py
+++ b/chroma/project.py
@@ -3,9 +3,9 @@ from chroma.transform import normalize
def from_film(position=(0,0,0), axis1=(0,0,1), axis2=(1,0,0), size=(800,600),
width=35.0, focal_length=18.0):
- """Project rays from a piece of film located at whose focal point is
- located at `position`. `axis1` and `axis2` specify the vectors pointing
- along the length and height of the film respectively.
+ """Project rays from a piece of film whose focal point is located at
+ `position`. `axis1` and `axis2` specify the vectors pointing along the
+ length and height of the film respectively.
"""
height = width*(size[1]/float(size[0]))
@@ -33,4 +33,4 @@ def from_film(position=(0,0,0), axis1=(0,0,1), axis2=(1,0,0), size=(800,600),
grid += axis2*width/2 - axis1*height/2
grid -= np.cross(axis1,axis2)*focal_length
- return grid+position, normalize(-grid)
+ return np.tile(position,(n,1)), normalize(-grid)