电信主站 网通分站
购买流程 付款方式 常见问题 在线提问 续租服务 购物车
用户名: 密 码: 忘记密码?
首 页
域名注册
虚拟主机
双线主机
服务器租用
VPS主机
企业邮局
代理专区
客服中心
虚拟主机行业资讯 虚拟主机评测对比 互联网最新动态 技术学院 站长资讯 在线教程 网站运营
搜索优化 服务器 网络编程 图形图象 站长之家 网页制作 操作系统
冲浪宝典 软件教学 视频通信 办公软件 邮件系统 网络安全 认证考试
您当前位置:西部数码->资讯中心-> 图形图象-> Director教程
director 3d 基础(之六)_director教程
作者:网友供稿 点击:0
  西部数码-全国虚拟主机10强!20余项虚拟主机管理功能,全国领先!第6代双线路虚拟主机,南北访问畅通无阻!虚拟主机可在线rar解压,自动数据恢复设置虚拟目录等.虚拟主机免费赠送访问统计,企业邮局.Cn域名注册10元/年,自助建站480元起,免费试用7天,满意再付款!P4主机租用799元/月.月付免压金!
文章页数:[1] 
以下的事件控制显示修饰3D文本的字面。显示字面组合可以包括显示延展文本的前面、背面、字厚度,以及其它面的一些组合效果。举例说明,如果你只是选择显示前面和字厚度,背面就不会在3D文本上显示。

on setDisplayFace
if member(‘‘textSample‘‘).displayFace = [#front] then
member(‘‘textSample‘‘).displayFace = [#tunnel]
setComment

else if member(‘‘textSample‘‘).displayFace = [#tunnel] then
member(‘‘textSample‘‘).displayFace = [#back]
setComment

else if member(‘‘textSample‘‘).displayFace = [#back] then
member(‘‘textSample‘‘).displayFace = [#back, #tunnel]
setComment

else if member(‘‘textSample‘‘).displayFace= [#back, #tunnel] then
member(‘‘textSample‘‘).displayFace = [#front, #tunnel]
setComment

else if member(‘‘textSample‘‘).displayFace=[#front,#tunnel] then
member(‘‘textSample‘‘).displayFace = [#front, #back, #tunnel]
setComment

else if member(‘‘textSample‘‘).displayFace = [#front, #back, #tunnel] then

member(‘‘textSample‘‘).displayFace = [#front]
setComment

end if
end

五、3Dtext2

当你打开并播放3Dtext2样版影片,你可以通过点击舞台左上角的按钮延展文本进3D世界。你可以点击另外两个按钮以应用一个材质球于每个字母。所有这三个按钮都有调用以下事件的行为,你可以在movie script中找到以下事件。
以下代码是一个错误捕捉,如果一个3D文本已经存在于3D世界中就促使这个事件退出。如果模型已经存在,而你试图创建另一个同名的,一个错误信息会出现。

on extrudeTextToWorld
if not(member(‘‘scene‘‘).model(‘‘3dText‘‘).voidP) then exit

prepareShaders事件调用创建所有影片中的材质球事件。PrepareLightAndCamera事件调用设定影片的灯光与摄像机位置的事件。要预备灯光和摄像机位置,你必须先保证你在影片中的文本已经是看得见的。
以下的代码定义延展文本象一个模型资源一样,并把它指派给一个方便使用的变量:
textModelResource = member(‘‘textSample‘‘).extrude3d(member(‘‘scene‘‘))
以下的代码创建一个新的模型,用上了新的textModelResource变量。
nm = member(‘‘scene‘‘).newModel(‘‘3dText‘‘, textModelResource)
这个新的模型延展文字“I』m shocked!”,由于这些文字有11个字母(包括标点符号),所以它有11个材质球――每个字母一个。
以下的脚本循环指派同样的材质球给每一个字母:

repeat with x = 1 to member(‘‘scene‘‘).model(‘‘3dText‘‘).shaderList.count

member(‘‘scene‘‘).model(‘‘3dText‘‘).shaderList[x] = member(‘‘scene‘‘).shader(‘‘shMetal‘‘)

end repeat
end

这些代码为模型创建一个材质球和贴图:

on prepareShaders
member(‘‘scene‘‘).newTexture(‘‘texMetal‘‘, #fromCastMember, member(‘‘metallic‘‘))

member(‘‘scene‘‘).shader(‘‘shMetal‘‘).texture = member(‘‘scene‘‘).texture(‘‘texMetal‘‘)

这些代码为模型创建另一个材质球和贴图。它使用newTexture函数去添加贴图到贴图列表并指派贴图到shLines材质球。

member(‘‘scene‘‘).newTexture(‘‘texLines‘‘, #fromCastMember, member(‘‘lines‘‘)) member(‘‘scene‘‘).newShader(‘‘shLines‘‘, #standard)

member(‘‘scene‘‘).shader(‘‘shLines‘‘).texture = member(‘‘scene‘‘).texture(‘‘texLines‘‘)

end
以下的事件设定演员的directionalPreset , directionalColor , and ambientColor属性。这些是用于修饰“scene”的灯光的。

on prepareLightAndCamera
member(‘‘scene‘‘).directionalPreset = #bottomLeft
member(‘‘scene‘‘).directionalColor = rgb(255, 255, 255)
member(‘‘scene‘‘).ambientColor = rgb(255, 255, 255)

这些代码移动摄像机到新的模型的位置:

member(‘‘scene‘‘).camera[1].transform.position = vector(266, 0, 300)
member(‘‘scene‘‘).camera[1].transform.rotation = vector(0, 0, 0)

end

以下的事件应用shLines材质球于一半的字母。注意到shLines材质球仅仅应用于材质球列表中的奇数条;shMetal材质球将显示于其它字母。这儿利用了mod函数,这儿是用来除以2,得到的余数是1或者0。

on addLinesToHalf
if member(‘‘scene‘‘).model(‘‘3dText‘‘).voidP then exit
repeat with x = 1 to member(‘‘scene‘‘).model(‘‘3dText‘‘).shaderList.count
if x mod 2 = 1 then -- if x is an odd number
member(‘‘scene‘‘).model(‘‘3dText‘‘).shaderList[x] =
member(‘‘scene‘‘).shader(‘‘shLines‘‘)
else
member(‘‘scene‘‘).model(‘‘3dText‘‘).shaderList[x] =
member(‘‘scene‘‘).shader(‘‘shMetal‘‘)
end if

end repeat
end

以下的事件指派shLines材质球于所有的字母:

on addLinesToAll
if member(‘‘scene‘‘).model(‘‘3dText‘‘).voidP then exit
repeat with x = 1 to member(‘‘scene‘‘).model(‘‘3dText‘‘).shaderList.count

member(‘‘scene‘‘).model(‘‘3dText‘‘).shaderList[x] = member(‘‘scene‘‘).shader(‘‘shLines‘‘)

end repeat

end

文章整理:西部数码--专业提供域名注册虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!
相关主题
文章页数:[1] 
Google
热门文章
·director技巧--关于text scroll 的问题_director教程
·lingo常用辞典- c_director教程
·lingo常用辞典- c_director教程
·lingo常用辞典- c_director教程
·lingo常用辞典- d_director教程
·lingo常用辞典- e_director教程
·lingo常用辞典- f_director教程
·lingo常用辞典- g_director教程
·lingo常用辞典- h_director教程
·lingo常用辞典- i_director教程

最新文章
·windows xp操作系统中隐藏的20个秘密_windows xp
·photoshop定义粗大虚线笔刷绘制幽默自画像_photoshop教程
·photoshop为七夕情人节打造亲密爱人相框_photoshop教程
·photoshop通道互换法调整照片色调_photoshop教程
·director生成文件减肥技巧_director教程
·用director控制动画gif_director教程
·director怎样制作自定义光标_director教程
·利用director.ini调试应用程序_director教程
·director使用mui xtra创建对话框_director教程
·director应用技巧_director教程


 
 


版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!

特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
  打印  刷新  关闭
返回首页 |关于我们 | 联系我们 | 付款方式 | 创业联盟 | 虚拟主机 | 资讯中心 | 友情链接 | 网站地图

版权所有 西部数码(www.west263.com)
CopyRight (c) 2002~2006 west263.com all right reserved.
公司地址:四川成都市万和路90号天象大厦4楼 邮编:610031
电话总机:028-86262244 86263048 86263408 86263960 86264018 86267838
售前咨询:总机转201 202 203 204 206 208
售后服务:总机转211 212 213 214
财务咨询:总机转224 223 传真:028-86264041 财务QQ:点击发送消息给对方635483282
售前咨询QQ:点击发送消息给对方2182518 点击发送消息给对方241975952 点击发送消息给对方275026793 点击发送消息给对方408235859
售后服务QQ:点击发送消息给对方17708515 点击发送消息给对方307742704 点击发送消息给对方287976517 点击发送消息给对方363783715
《中华人民共和国增值电信业务经营许可证》编号:川B2-20030065号