纳金网

标题: Transform Ease (Script Utilities Behavior) [打印本页]

作者: Asen    时间: 2011-10-15 10:53
标题: Transform Ease (Script Utilities Behavior)






               Transform Ease (Script Utilities Behavior)
              









           Summary
         

           Adds a few properties and methods to every Node for working with transformation matrices.
         





               Category
              


              Latest Behaviors
            




               Author
              


              Gavin Kistner
            




               Difficulty
              


              (Reference)
            




               Time to Complete
              


              5 Minutes
            








           Downloads
         


            Click Here
           
           to download the associated files.
         


            (This document covers version 0.9 of the 'Transform Ease' behavior, current as of 2005-Mar-21)
           

            Description
           


             This behavior extends every Node (Camera, Light, Group, Model, and Text objects) with three new properties and two new methods. To use, simply attach this behavior anywhere in the scene. (You have to actually attach it to add the functionality; loading it into the library for the project is not enough.)
            

              
            


              
            


              myNode.lastLocalTransform
            


             Like the
            
              lastGlobalTransform
            
             property, this property returns a transformation matrix from the previous frame.
            

             Unlike
            
              lastGlobalTransform
            
             , the transformation is for the node with respect to its parent, not with respect the scene.
            

              
            


              
            


              myNode.currentGlobalTransform
            


             Like
            
              lastGlobalTransform
            
             , this property is a matrix holding the transformation matrix for the object with respect to the scene.
            

             Unlike
            
              lastGlobalTransform
            
             , the transformation is for the current state of the object, not the previous frame.
            

             Changes already made to transformations (position, scale, rotation, and pivot) on any ancestor of the object during the current frame will be reflected in this matrix, but references to the returned matrix are not automatically updated as objects are transformed. (You must assign a new variable to the property to force the matrix to be recomputed after changing the transformation on the object or its ancestors.)
            



               WARNING
              

             : It is computationally expensive to calculate this matrix, requiring one function call and four matrix multiplications for every ancestor of the object. If you can use
            
              lastGlobalTransform
            
             instead, you should.
            

              
            


              
            


              myNode.currentLocalTransform
            


             Like
            
              currentGlobalTransform
            
             , but returns the transformation matrix of the calling node with respect to the parent of that node.
            



               WARNING
              

             : It is computationally expensive to calculate this matrix, requiring one function call and four matrix multiplications. If you can use
            
              lastLocalTransform
            
             instead, you should.
            

              
            


              
            


              myNode.lastTransformFrom(
              
               inAncestor
              
              ,
              
               outMatrix
              
              )
            


             Returns the transformation matrix for the calling node with respect to an arbitrary ancestor, using information from the last frame.
            

             The
            

               inAncestor
              

             parameter should be a node that is an ancestor of the calling node. If this value is not passed (or is not a node) the return value is the
            
              lastGlobalTransform
            
             for the calling node.
            

             If the
            

               outMatrix
              

             parameter is supplied, that matrix will be modified and returned; otherwise, a new matrix will be created and returned.
            

             (Re-using the same matrix across successive calls to this method will result in slightly better memory performance, since a new Matrix will not be allocated each time.)
            

              
            


              
            


              myNode.currentTransformFrom(
              
               inAncestor
              
              ,
              
               outMatrix
              
              )
            


             Returns the transformation matrix for the calling node with respect to an arbitrary ancestor, using information from the current frame.
            

             The
            

               inAncestor
              

             parameter should be a node that is an ancestor of the calling node. If this value is not passed (or is not a node, or is not an ancestor of the calling node) then the return value will be the same as the
            
              currentGlobalTransform
            
             matrix for the calling node.
            

             If the
            

               outMatrix
              

             parameter is supplied, the matrix will be modified and returned; otherwise, a new matrix will be created and returned.
            

             (Re-using the same matrix across successive calls to this method will result in slightly better memory performance, since a new Matrix will not be allocated each time.)
            



               WARNING
              

             : It is computationally expensive to calculate this matrix, requiring one function call and four matrix multiplications for every below the ancestor node (including the calling node). If you can use the
            
              lastTransformFrom(...)
            
             method instead, you should.
            



作者: tc    时间: 2012-4-18 23:21
“再次路过……”我造一个-----特别路过

作者: 奇    时间: 2012-4-24 08:05
爱咋咋地!

作者: 晃晃    时间: 2012-5-9 23:26
都闪开,介个帖子,偶来顶

作者: tc    时间: 2012-5-10 23:21
呵呵,很好,方便罗。

作者: 奇    时间: 2012-5-29 23:27
先顶上去,偶要高亮加精鸟!

作者: 菜刀吻电线    时间: 2012-6-17 23:19
呵呵,很好,方便罗。

作者: C.R.CAN    时间: 2012-6-29 23:24
呵呵,很好,方便罗。

作者: C.R.CAN    时间: 2012-7-28 23:26
我是老实人,我来也!

作者: 菜刀吻电线    时间: 2013-2-7 00:19
先垫一块,再说鸟





欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5