首页 > 如何将花叶组合在一起?

如何将花叶组合在一起?

var flower_pot=new mono.ComboNode([flow_final,mud],['+']);//组合体做成了一个花盆
    flower_pot=new mono.CSG(flower_pot);//将花盆定义为运算体
    var count = 6;
    for(var i=0;i<count;i++){
        var plant = new mono.Plane(150, 200);
        plant.s({
            'm.texture.image':preinstall.getRes('plant.png'),//得到花叶贴图
            'm.transparent': true,
            'm.side': mono.DoubleSide
        });
        plant.setPositionY(130);
        plant.setRotationY(Math.PI/count*i);//设置plant旋转角度
        flower_pot=flower_pot.union(new mono.CSG(plant));//运算体将花盆和每个花叶组合
    }
    flower_pot=flower_pot.toMesh();//使用toMesh方法
    box.add(flower_pot);
  

利用赛瓦软件绘制花盆,花盆里有花,使用运算体想把6片花叶和花盆组合在一起
但使用如上代码,只有两片花叶组合在一块了。


使用css绝对定位,通过z-index,2D旋转应该就能组合了,没必要JS吧,最好贴一下花的图片

【热门文章】
【热门文章】