zoukankan      html  css  js  c++  java
  • 排列顶点 uv 不过有很大问题


    -- curb unwrapper(version 0.1, 6th may  2004)
    -- MAX script, tested with 3ds MAX 5.1

    -- (c) 2004 Andrei Kletskov (111)
    -- homepage: http://andklv.narod.ru
    -- e-mail: andklv@mail.ru
    -- please do not remove any copyrights from this script

    -- Description --
    -- this script was designed to ease texturing of complex objects like curbs, sidewalks, roads, etc.
    -- in fact this script unwraps texture coordinates to a line
    -- generally the script is sucsessful, but it fails if geometry is uneven and sometimes it mixes rows of vertices.
    -- unfortunately this script does not count on different poligon sized
    -- what you need to do to make this script work:
    -- break your curb to parts with equal polygon lenghts
    -- select a first row of vertices in an element
    -- run script
    -- script will unwrap vertices in lines
    -- do the same with other elements
    -- note: it is very important to start  with first row of vertices - this is a way the script works. sorry.

    --2100.10.13 这个uv 工具其实很好了但是测试还是有多的问题,
    --- 主要还是在顶点排列上, 看来还是要转到3d 中进行

    rollout ak_curb_unwraper "Curb unwraper" 162 height:300
    (
     button btn1 "Unwrap!" pos:[5,5] 107 height:30
     label lbl1 "Width st." pos:[65,40] 50 height:16
     label lbl2 "Length st." pos:[5,40] 50 height:16 
     spinner lenStep "" pos:[5,60] 50 height:16 range:[0,100000,0]
     spinner widStep "" pos:[60,60] 50 height:16 range:[0,100000,0]
     checkbox vert "Vertical unwrap" pos:[5,80] 100 height:16
     checkbox elem "Select element" pos:[5,100] 100 height:16
     
     
     on btn1 pressed  do
     (
     
      btn1.enabled = false

    --- length steps
    lengthSTEP = lenStep.value
    --- width steps
    widthSTEP = widStep.value
    --- horizontal or vertical
    VERTICAL = vert.state
    --- select element
    elementSELECT = elem.state

    --- initial selection
    y = $.modifiers[#unwrap_uvw].unwrap.getSelectedVertices() --经过分析这里的点分析还是有误

    --- initial selection aligning
      
     -- VERTICAL= false
    j=0
      --widthSTEP=0.05
    for i in y do
    (
     if VERTICAL then
      $.modifiers[#unwrap_uvw].unwrap.setVertexPosition 0 i [j,0,0]
     else
      $.modifiers[#unwrap_uvw].unwrap.setVertexPosition 0 i [0,j,0]
     j=j+widthSTEP
    )

    k=0
    --lengthSTEP=0.036


    while true do
    (
     k=k+lengthSTEP
     --- expand selection
     $.modifiers[#unwrap_uvw].unwrap.expandSelection()
     --- select expanded
     h = $.modifiers[#unwrap_uvw].unwrap.getSelectedVertices()
     --- added vertices during expand
     x=(h-y)
     --print x
     if x.isEmpty then exit
     $.modifiers[#unwrap_uvw].unwrap.selectVertices x 
     j=0
     for i in x do
     (
      --$.modifiers[#unwrap_uvw].unwrap.selectVertices #{i}
      if VERTICAL then
       $.modifiers[#unwrap_uvw].unwrap.setVertexPosition 0 i [j,k,0]
      else
       $.modifiers[#unwrap_uvw].unwrap.setVertexPosition 0 i [k,j,0]
      j=j+widthSTEP
     )
     y=h
    )

    --- selecting element
    if elementSELECT then
     $.modifiers[#unwrap_uvw].unwrap2.selectElement()
    else
     $.modifiers[#unwrap_uvw].unwrap.selectVertices #{}


      btn1.enabled = true
     )
    )


    rollout ak_about "About" 162 height:300
    (
     label lbl3 "(c) 2004" pos:[5,5] 100 height:20
     label lbl4 "Andrei Kletskov (111)" pos:[5,20] 110 height:20
     label lbl5 "http://andklv.narod.ru" pos:[5,35] 110 height:20
     label lbl6 "andklv@mail.ru" pos:[5,50] 100 height:20
    )


    rf = newRolloutFloater "CU" 130 172

    addRollout ak_curb_unwraper rf 
    addRollout ak_about rf
    ak_about.open = 0
    ak_curb_unwraper.widStep.value = 0.1
    ak_curb_unwraper.lenStep.value = 0.5

  • 相关阅读:
    报表选型应该知道的
    报表工具——开源还是商用
    地图报表怎么做?
    关于报表在移动端展现需你需要知道哪些?
    报表怎样实现滚动的公告效果?
    加速JDBC的快捷方法
    百万级分组大报表开发与呈现
    秒级展现的百万级大清单报表怎么做
    润乾集算器技术文档汇总
    报表使用相关知识及技巧汇总
  • 原文地址:https://www.cnblogs.com/gaitian00/p/2210535.html
Copyright © 2011-2022 走看看