File indexing completed on 2026-04-09 07:48:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 """
0022 This turned out not to help much, easier to simply construct
0023 eye-look-up array directly as done in:
0024
0025 flightpath.py
0026 early attempts, at mpl viz of flight path with 3D arrows,
0027 quiver plots turned out to be a better way
0028
0029 mm0prim2.py
0030 xz + xy circles path and testing flightpath cmds
0031
0032 """
0033 import numpy as np
0034
0035 class View(object):
0036 EYE = 0
0037 LOOK = 1
0038 UP = 2
0039 def __init__(self, eye=[-1,1,0], look=[0,0,0], up=[0,0,1], dtype=np.float32 ):
0040 self.v = np.zeros( (4,4), dtype=dtype )
0041 self.eye = eye
0042 self.look = look
0043 self.up = up
0044
0045 def _set_eye(self, a ):
0046 self.v[self.EYE,:3] = a[:3]
0047 def _get_eye(self):
0048 return self.v[self.EYE,:3]
0049 eye = property(_get_eye, _set_eye)
0050
0051 def _set_look(self, a ):
0052 self.v[self.LOOK,:3] = a[:3]
0053 def _get_look(self):
0054 return self.v[self.LOOK,:3]
0055 look = property(_get_look, _set_look)
0056
0057 def _set_up(self, a ):
0058 self.v[self.UP,:3] = a[:3]
0059 def _get_up(self):
0060 return self.v[self.UP,:3]
0061 up = property(_get_up, _set_up)
0062
0063
0064
0065 if __name__ == '__main__':
0066
0067 v = View()
0068 print repr(v.v)
0069
0070 v.eye = [3,3,3]
0071 print repr(v.v)
0072
0073
0074
0075