[yt-svn] commit/yt: MatthewTurk: Adding rotation to fisheye camera
Bitbucket
commits-noreply at bitbucket.org
Mon Jan 16 19:17:27 PST 2012
1 new commit in yt:
https://bitbucket.org/yt_analysis/yt/changeset/bc6093719736/
changeset: bc6093719736
branch: yt
user: MatthewTurk
date: 2012-01-16 23:41:17
summary: Adding rotation to fisheye camera
affected #: 1 file
diff -r 4afeef8b095e8271c8412d65931cdded98462ee2 -r bc60937197364d7c83ad75cec5b9216b96e961a5 yt/visualization/volume_rendering/camera.py
--- a/yt/visualization/volume_rendering/camera.py
+++ b/yt/visualization/volume_rendering/camera.py
@@ -797,8 +797,10 @@
def __init__(self, center, radius, fov, resolution,
transfer_function = None, fields = None,
sub_samples = 5, log_fields = None, volume = None,
- pf = None, no_ghost=False):
+ pf = None, no_ghost=False, rotation = None):
ParallelAnalysisInterface.__init__(self)
+ if rotation is None: rotation = na.eye(3)
+ self.rotation = rotation
if pf is not None: self.pf = pf
self.center = na.array(center, dtype='float64')
self.radius = radius
@@ -825,6 +827,10 @@
# ...but all in Cython.
vp = arr_fisheye_vectors(self.resolution, self.fov)
vp.shape = (self.resolution**2,1,3)
+ vp2 = vp.copy()
+ for i in range(3):
+ vp[:,:,i] = (vp2 * self.rotation[:,i]).sum(axis=2)
+ del vp2
uv = na.ones(3, dtype='float64')
positions = na.ones((self.resolution**2, 1, 3), dtype='float64') * self.center
vector_plane = VectorPlane(positions, vp, self.center,
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list