查看: 3|回复: 3

如何实现一个发生器产生三种形状不同的产品

[复制链接]

主题

0

回帖

126

积分

注册会员

积分
126
发表于 2022-11-24 15:43:15 | 显示全部楼层 |阅读模式
产生三种产品的形状不相同应该怎么实现

主题

0

回帖

344

积分

注册会员

积分
344
发表于 2022-11-25 09:08:50 | 显示全部楼层
可以使用setobjectshapeindex()语句实现

主题

0

回帖

126

积分

注册会员

积分
126
 楼主| 发表于 2022-11-25 21:28:56 | 显示全部楼层
[quote][size=2][url=forum.php?mod=redirect&goto=findpost&pid=34359&ptid=12066][color=#999999]小赵同学 发表于 2022-11-25 09:08[/color][/url][/size]
可以使用setobjectshapeindex()语句实现[/quote]

这个括号里的格式怎么写

主题

0

回帖

544

积分

中级会员

积分
544
发表于 2022-11-26 11:45:31 | 显示全部楼层
触发中有现成的代码,稍微修改一下就可以用。


[code]/**Change 3D Shape*/
Array shapename=["fs3d\\General\\Box.3ds","fs3d\\General\\Cylinder.3ds","fs3d\\General\\Sphere.3ds"];
Array size=[[0.61,0.61,0.3],[0.7,0.7,0.8],[0.5,0.5,0.5]];
double theindex = duniform(1,3);

//Get the size of the item
double x = size[theindex][1];
double y = size[theindex][2];
double z = size[theindex][3];

//Change 3D Shape
sets(shape(item),shapename[theindex]);
setobjectshapeindex(item,theindex);

//Update the item size
applyshapefactors(item);
setsize(item, x, y, z);

//Set item Type and color
item.Type=theindex;
item.color=Color.byNumber(theindex);[/code]

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注公众号

相关侵权、举报、投诉及建议等,请发 E-mail:admin@discuz.vip

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.|京ICP备14043114号-2

在本版发帖
关注公众号
QQ客服返回顶部