用户名: 密码: 免费注册 忘记密码? 网站地图 | 加入收藏 | 设为首页
首页 | 新闻 | 工具 | 系统 | 办公 | 聊天 | 多媒体 | 网页 | 运营 | 平面 | 欣赏 | 数据库 | 程序 | 服务器 | 组网
网页 | 3dmax | Ghost | Windows Xp| Dreamweaver | photoshop | Flash | office | Alexa | Css | QQ | Asp | PHP | Jsp | Access
Flash MX 2004入门 | 网站推广策略 | CorelDRAW入门 | ASP学习 | 网站建设大师功 | Word入门
  iTbulo.com > 学院 > 多媒体教程 > Director教程 > 文章正文
ShockWave 3D 制作系列教程之二
iTbulo.COM 2006-3-13 sunshine()

以下程序主要是建立一个正方体并为其添加材质,请看程序:

property pscene,myTexture

on beginsprite me

pscene=member("scene")

pscene.resetworld()

--创建正方体

makebox(me)

end

on exitframe me

--令物体以X,Z轴旋转

pscene.model("box").transform.rotate(-1,0,-1)

end

on makebox me

--定义正方体的资源参数

boxresource = pscene.newmodelresource("boxresource",#box)

--设置宽度

boxresource.width = 50

--设置高度

boxresource.height = 50

--设置长度

boxresource.length = 50

--产生物体

pbox = pscene.newModel("box",boxresource)

--对六个面进行贴图

repeat with i=1 to 6

--把演员库中的位图放进3D场景中作为稍图

pscene.newtexture("map" & i,#fromcastmember,member(i,"texture"))

--新增阴影渐变面

pscene.newshader("boxshader" & i, #standard)

--为每个渐变面赋予一材质

pscene.shader("boxshader"& i).texture = pscene.texture("map" & i)

end repeat

--对每一个面贴图

repeat with i = 1 to pbox.shaderList.count

pbox.shaderList[i] = pscene.shader("boxshader" & i)

end repeat

end

通过本例子您已经大概了解了简单模型的建立和贴图技巧

上一页  [1] [2] 

文章搜索
相关资讯
相关文章 相关下载
ShockWave 3D 制作系列教程之三
ShockWave 3D 制作系列教程之一
焦点信息