Commit b99e9583 authored by David E. DeMarle's avatar David E. DeMarle

correct the phi theta center of rotation

original calculation was wrong
parent 1d760de4
......@@ -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