zoukankan      html  css  js  c++  java
  • 进行随机旋转用于和并东西并

    --随机树角度
    oArray = $selection as array
    clearSelection()
    for i in oArray do
    (
     --随机角度
     angleValue = (random 5 30) *3
     --format "角度:% /n" angleValue
     
     rotate i (angleaxis (random 0 90) [0,0,1])
    )
    --合并树递归方法
    function attachTree oArray isRandHeight =
    (
     if oArray.count < 2 then
     (
      return "选择合并数量必须大于等于2"
     )
     step = 50
     if oArray.count>step then
     (
      oArray2 = getCurrentSelection()
      for i =1 to oArray.count by step do
      (
       j = i
       k = i+step
       l = i
       while (l+1)<k do
       (
        --format "TTT:% , % /n"  l oArray.count
        if l>=oArray.count then
        (
         exit
        )
        oArray[j].attach oArray[l+1] oArray[j]
        format "第一组合并进度:% , % ,%/n "  l k oArray.count
        l+=1
       )
       --print isRandHeight
       if isRandHeight then
       (
        max modify mode
        modPanel.setCurrentObject oArray[j]
        subOjbectlevel = 1
        --当前选择的点总数
        faceCount = polyop.getNumVerts oArray[j]
        --format "顶点总数:% /n" faceCount
        for i = 0 to (faceCount-8) by 8 do
        (
         --随机高度值
         heightValue = (random -.5 .5)*3
         --format "高度值:% ,i 值:%/n" heightValue i
         vertArray = #{i+3,i+4,i+7,i+8}
         oArray[j].EditablePoly.SetSelection #Vertex vertArray
         move oArray[j].selectedverts [0,heightValue,0]
        )
        modPanel.setCurrentObject oArray[j].baseObject
        clearSelection()
       )
       --isRandHeight = false
       append oArray2 oArray[j]
      )
      --print oArray2.count
      --print oArray2
      attachTree oArray2 false
     )
     else
     (
      --print oArray
      oArrayCount = oArray.count
      for i = 2 to oArrayCount do
      (
       format "第二组合并进度:% ,%/n"  i oArray.count
       oArray[1].attach oArray[i] oArray[1]
      )
      
     )
     select oArray[1]
    )
    --合并树
    attachTree oArray true

  • 相关阅读:
    Protocol handler start failedCaused by: java.net.SocketException: Permission denied
    springboot无法获取证书内容
    IDEA中使用git合并分支的过程报错:cant checkout because of unmerged files
    IDEA中使用git报错Permission denied (publickey)
    linux常用的操作命令
    启动Tomcat报错:A child container failed during start
    linux下搭建redis内网端口映射工具-rinetd
    linux(centos)下安装supervisor进程管理工具
    SDBCI-WRCF2020-MI赛题成绩回顾
    Google搜索技巧
  • 原文地址:https://www.cnblogs.com/gaitian00/p/2210291.html
Copyright © 2011-2022 走看看