Commit f6f500e4 authored by David E. DeMarle's avatar David E. DeMarle Committed by Kitware Robot

Merge topic 'fix-phi-theta-COR'

b99e9583 correct the phi theta center of rotation
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !123
parents 318c6238 b99e9583
Pipeline #120139 failed with stage
in 0 seconds
......@@ -308,11 +308,9 @@ class Camera(explorers.Track):
theta_rad = float(theta) / 180.0 * math.pi
phi_rad = float(phi) / 180.0 * math.pi
pos = [
float(self.center[0]) -
math.cos(phi_rad) * self.distance * math.cos(theta_rad),
float(self.center[1]) +
math.sin(phi_rad) * self.distance * math.cos(theta_rad),
float(self.center[2]) + math.sin(theta_rad) * self.distance
math.sin(theta_rad) * self.distance
]
up = [
+ math.cos(phi_rad) * math.sin(theta_rad),
......@@ -322,6 +320,9 @@ class Camera(explorers.Track):
for i in range(self.offset):
pos.insert(0, pos.pop())
up.insert(0, up.pop())
pos[0] = float(self.center[0]) - pos[0]
pos[1] = float(self.center[1]) + pos[1]
pos[2] = float(self.center[2]) + pos[2]
self.view.CameraPosition = pos
self.view.CameraViewUp = up
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment