From: Bruce S. <bas...@un...> - 2004-03-15 02:37:30
|
I've added Jonathan's routine to the on-line documentation for "frame" and also updated the Doc zip file that can be downloaded. Thanks, Jonathan. This does leave open the question however as to whether there ought not be a method in Visual for resolving pos and axis information. In particular, I believe that even Jonathan's routine isn't really complete if this frame is inside another frame: one should really recurse up the enclosing frames. Bruce Sherwood Jonathan Brandmeyer wrote: > Let me amend that routine. You also have to normalize the y_axis vector > (smacks self on head). > > def world_space_pos( frame, local): > """Returns the position of local in world space.""" > x_axis = norm(frame.axis) > z_axis = norm(cross(frame.axis, frame.up)) > y_axis = norm(cross(z_axis, x_axis)) > return frame.pos + local.x*x_axis + local.y*y_axis + local.z*z_axis |