码迷,mamicode.com
首页 > 其他好文 > 详细

layabox 3d 入手

时间:2018-09-02 00:08:16      阅读:220      评论:0      收藏:0      [点我收藏+]

标签:poi   dir   point   rect   1.2   vector   聚光灯   instant   for   

最近受到打击了,3d效果远比2d效果好。

Laya.Sprite3D.load(XX.lh);

克隆Laya.Sprite3D.instantiate

Laya.Mesh.load(XXX.lm);

var directionLight = scene.addChild(new Laya.DirectionLight());
directionLight.color = new Laya.Vector3(0.7, 0.6, 0.6);
directionLight.direction = new Laya.Vector3(0, -1.0, -1.0);

var pointLight = scene.addChild(new Laya.PointLight());
pointLight.color = new Laya.Vector3(0.1189446, 0.5907708, 0.7352941);
pointLight.transform.position = new Laya.Vector3(0.4, 0.4, 0.0);
pointLight.attenuation = new Laya.Vector3(0.0, 0.0, 3.0);
pointLight.range = 3.0;

//聚光灯
var spotLight = scene.addChild(new Laya.SpotLight());
spotLight.color = new Laya.Vector3(1, 1, 0);
spotLight.transform.position = new Laya.Vector3(0.0, 1.2, 0.0);
spotLight.direction = new Laya.Vector3(0.15, -1.0, 0.0);
spotLight.attenuation = new Laya.Vector3(0.0, 0.0, 0.8);
spotLight.range = 6.0;
spotLight.spot = 32;

layabox 3d 入手

标签:poi   dir   point   rect   1.2   vector   聚光灯   instant   for   

原文地址:https://www.cnblogs.com/honghong87/p/9571798.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!