首页 | 互联网 | IT动态 | IT培训 | Cisco | Windows | Linux | Java | .Net | Oracle | 软件测试 | C/C++ | 嵌入式开发 | 存储世界 | 服务器
网络设备 | IDC | 安全 | 求职招聘 | 数字网校 | 网页设计 | 平面设计 | 技术专题 | 电子书下载 | 教学视频 | 源码下载 | 搜索 | 博客 | 论坛
 Dreamweaver | Flash
 Fireworks  | Frontpage
 HTML/CSS  | Javascript
 Photoshop  | CorelDraw
 AuotoCAD   | Illustrator
 Freehand
 3DMax    | Authorware
 Director   | Maya
 PP点点通 | 迅雷 | BT
 eMule | FlashGet | Nero
 Ghost | Outlook | IE
 Maxthon | Office
 QQ | MSN | 网易泡泡
 Skype | 雅虎通 | 新浪UC

最新文章

您现在的位置: 中国IT实验室 >> 多媒体 >> Director学习教程 >> 正文

使Director创作过程自动化


ChinaItLab  2007-6-18 佚名  保存本文   推荐给好友  收藏本站


◆ 网页平面多媒体培训、认证考试免费咨询热线:400-700-5807   进入网络咨询平台


  
  快速绘图

  创作脚本不仅仅在适应或改变现有的ASSETS上有作用。你也可以用它们创建图形。最近,我在一个教育站点从事包括大量几何图形的数学的工作,而且很快我便厌烦了用Photoshop 创建图形。所以我创建了一些程序使我被允许在Director 中画几何图形。这里是一个例子:
 
on drawsquare w, nm, col, bg, s
 
 v=new (#vectorshape)
 v.vertexlist = [[#vertex: point (0, 0)], [#vertex: point (0, w)], [#vertex: point
 (w, w)],
 [#vertex: point (w, 0)]]
 if voidp (bg) then bg = rgb (255, 255, 255)
 if voidp (col) then col = rgb (0, 0, 0)
 if voidp (s) then s = 1
 v.backgroundcolor = bg
 v.strokecolor = col
 v.strokewidth = s
 v.closed = 1
 v.fillmode = #none
 mem = new (#bitmap)
 mem.image = v.image
 mem.name = string (nm)
 erase v
 
end
   
  这个例子相当的简单,但是你可以用这个程序很长时间。那么,这个怎么样:一种画曲径的方法。我们用这种形式的数据清单供给它:[[1,2],[0,1]]。每一个数字代表曲径里一个单一的正方形,and has a value representing whether there is a wall to the right or to the
  right or to the bottom of that square.
  因此:
  
  0 = exit at bottom and right
  
  1 = exit at bottom
  
  2 = exit at right
  
  3 = no exit to bottom or right
  
  我们不必担心会离开当前命令行外壳到顶部或是左边,因为那是多余的,并且我们假定曲径在每
  一边都是关闭的。我们可以开始画了。
  
on drawmaze m, w
  if voidp (w) then w = 20
  vert = m.count
  hor = m[1].count
  maze = image (w * hor + 1, w * vert + 1, 16)
  repeat with i = 1 to vert
    repeat with j = 1 to hor
      sq = m[ i ][j]
      if sq mod 2 or i = vert then maze.draw ((j - 1) * w, i * w, j * w, i * w + 1,
      rgb (0, 0, 0))
      if sq > 1 or j = hor then maze.draw (j * w, (i - 1) * w, j * w + 1, i * w, rgb
      (0, 0, 0))
    end repeat
  end repeat
  maze.draw (0, 0, 1, w * vert, rgb (0, 0, 0))
  maze.draw (0, 0, w * hor, 1, rgb (0, 0, 0))
  
  mem = new (#bitmap)
  mem.image = maze
  
  
end
 
  试着做-在信窗口里写入:
  
  drawmaze ([[1,0,3,0],[0,3,0,0],[0,0,2,0]])
  
  检查你的内在成员Internal cast且一个新的曲径已经添加了。顺便提一下,这项技术不仅仅用于创作-它也可以用于运行时间,来保存文件大小。但是不要忘记你在运行时间里添加的每一个新的cast成员在被擦除之前都会在内存中,所以它可能在执行时产生影响。请确信在用完你的CAST成员后清除它们。

上一页  [1] [2] [3] 

【责编:Youping】


 相关文章  推荐文章
AfterEffects制作流光溢彩新年字幕
Painter手绘精美水彩荷花
灯光照明效果的Vray教程
三维设计专用技术名词解释
DIRECTOR去背技法步步高
3D章鱼的制作过程
幻影动画特效制作
牛人用Maya制作逼真眼球全过程
Director8新手上路--绘图工具
Director8新手上路--快速入门
 文章评论