火焰特效MaxScript——1.3版
实现功能:
在火焰的浓烈程度改变到一定数值之后
火焰的颜色会发生改变
同时增加一个控制火焰大小的slider
utility FireEffect "火焰特效" width:162 height:245 ( button btn1 "火焰" pos:[12,20] width:140 height:30 bitmap bmp1 "" pos:[12,70] width:140 height:120 button btn2 "渲染预览" pos:[51,205] width:64 height:21 rollout r1 "参数调节" width:162 height:245 ( spinner sp1 "浓烈程度: " pos:[16,7] width:133 height:16 range:[0,50,15] type:#float slider sl1 "火焰大小: " pos:[13,28] width:136 height:44 range:[0,100,80] on sp1 changed spValue do ( vf.density = spValue if spValue <= 15 then ( vf.inner_color = color 252 252 0 vf.outer_color = color 225 30 30 ) else if spValue >30 then ( vf.inner_color = color 253 255 94 vf.outer_color = color 144 126 255 ) else ( vf.inner_color = color 253 255 94 vf.outer_color = color 225 129 129 ) ) on sl1 changed slValue do ( sgizmo.radius = slValue ) ) on FireEffect open do ( addRollout r1 rollup:true ) on FireEffect close do ( removeRollout r1 ) on btn1 pressed do ( resetMaxFile #noprompt global sgizmo = spheregizmo radius:80 vf = fire_effect() addAtmospheric(vf) appendGizmo vf sgizmo cam = freeCamera pos:[0,180,0] target:(targetObject()) max vpt camera ) on btn2 pressed do ( view = render outputwidth:140 outputheight:120 vfb:off bmp1.bitmap = view ) )
点击“火焰”按钮
会先重置一下场景
再点击“渲染预览”按钮
拖动spinner 和slider之后再点击“渲染预览”按钮
观看效果
文章来源: blog.csdn.net,作者:fengda2870,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/fengda2870/article/details/5572697
- 点赞
- 收藏
- 关注作者
评论(0)