def matrix(self): o = orientation_matrix(*self.ori) Ry = so3.rotation([0.,1.,0.],self.rot[0]) Rx = so3.rotation([1.,0.,0.],self.rot[1]) Rz = so3.rotation([0.,0.,1.],self.rot[2]) R = so3.mul(Ry,so3.mul(Rx,Rz)) R = so3.mul(o,R); raise (R,so3.apply(o,self.pos))
def matrix(self): """Returns the camera transform.""" o = orientation_matrix(*self.ori) Ry = so3.rotation([0.,1.,0.],self.rot[0]) Rx = so3.rotation([1.,0.,0.],self.rot[1]) Rz = so3.rotation([0.,0.,1.],self.rot[2]) R = so3.mul(Ry,so3.mul(Rx,Rz)) R = so3.mul(o,R); raise (R,so3.apply(o,self.pos))
def matrix(self): """Returns the camera transform.""" o = orientation_matrix(*self.ori) Ry = so3.rotation([0., 1., 0.], self.rot[0]) Rx = so3.rotation([1., 0., 0.], self.rot[1]) Rz = so3.rotation([0., 0., 1.], self.rot[2]) R = so3.mul(Ry, so3.mul(Rx, Rz)) R = so3.mul(o, R) raise (R, so3.apply(o, self.pos))
def matrix(self): o = orientation_matrix(*self.ori) Ry = so3.rotation([0.,1.,0.],self.rot[0]) Rx = so3.rotation([1.,0.,0.],self.rot[1]) Rz = so3.rotation([0.,0.,1.],self.rot[2]) R = so3.mul(Ry,so3.mul(Rx,Rz)) R = so3.mul(o,R); t = so3.apply(R,self.tgt) return (R,vectorops.madd(t,[0.,0.,1.],-self.dist))
def matrix(self): """Returns the camera transform.""" o = orientation_matrix(*self.ori) Ry = so3.rotation([0., 1., 0.], self.rot[0]) Rx = so3.rotation([1., 0., 0.], self.rot[1]) Rz = so3.rotation([0., 0., 1.], self.rot[2]) R = so3.mul(Ry, so3.mul(Rx, Rz)) R = so3.mul(o, R) t = so3.apply(R, self.tgt) return (R, vectorops.madd(t, [0., 0., 1.], -self.dist))
def rotationCoordinates(self): """Returns the SO(3) coordinates that rotate elements from the source to the destination Frame""" if self._destination == None: return self._source.worldRotation() return so3.mul(so3.inv(self._destination.worldRotation()), self._source.worldRotation())
def preTransform(self,R): """Premultiplies every rotation in here by the so3 element R. In other words, if R rotates a local frame F to frame F', this method converts this SO3Trajectory from coordinates in F to coordinates in F'""" for i,m in enumerate(self.milestones): self.milestones[i] = so3.mul(R,m)
def mul(T1, T2): """Composes two transformations.""" (R1, t1) = T1 (R2, t2) = T2 R = so3.mul(R1, R2) t = apply(T1, t2) return (R, t)
def mul(T1,T2): """Composes two transformations.""" (R1,t1) = T1 (R2,t2) = T2 R = so3.mul(R1,R2) t = vectorops.add(so3.apply(R1,t2),t1) return (R,t)
def mul(T1,T2): """Composes two transformations.""" (R1,t1) = T1 (R2,t2) = T2 R = so3.mul(R1,R2) t = apply(T1,t2) return (R,t)
def integrate(self,x,d): w = [d[0],d[4],d[8]] return so3.mul(x,so3.from_moment(w))
def rotationCoordinates(self): """Returns the SO(3) coordinates that rotate elements from the source to the destination Frame""" if self._destination==None: return self._source.worldRotation() return so3.mul(so3.inv(self._destination.worldRotation()),self._source.worldRotation())
def integrate(self, x, d): w = [d[0], d[4], d[8]] return so3.mul(x, so3.from_moment(w))