moving the axes and let the polygon stay [SOLVED]



  • On 19/11/2014 at 13:59, xxxxxxxx wrote:

    Hi all,
    I want to move a polygon with his axis to Y=0 and let the polygon
    stay above it?
    To move the axis to 0 is no Problem.
    But what do I have to do that the polygon will stay above?

    Any ideas.

    Thanks a lot



  • On 20/11/2014 at 08:39, xxxxxxxx wrote:

    Hello,

    it seems there is no dedicated function to do this. You can edit the axis of an point object by moving the object and then transform the points of the object:

      
      if op == None:  
          return  
        
      if op.IsInstanceOf(c4d.Opoint) == False:  
          return  
        
      # the offset of the axis  
      offset = c4d.Vector(100,0,0)  
        
      # move object  
      m = op.GetMg()  
      m.off = m.off + offset  
      op.SetMg(m)  
        
      # transform points  
      padr = op.GetAllPoints()  
      pcnt = op.GetPointCount()  
        
      for i, point in enumerate(padr) :  
          point = point - offset  
          op.SetPoint(i,point)  
            
      op.Message(c4d.MSG_UPDATE)  
    

    In a more complex situation you may have to work with a offset matrix.

    best wishes,
    Sebastian



  • On 21/11/2014 at 00:56, xxxxxxxx wrote:

    Hey you arre my hero :-)

    Thanks for your code.
    Ronald


Log in to reply