vue-3d-model
vue-3d-model copied to clipboard
目前<model-obj >有smoothing属性,<model-stl>是怎么实现的,谢谢
用鼠标转动的时候,背面没有光照,这个问题我添加了代码,但没有实现,还有,目前
你可以通过lights
属性来指定光照的类型和位置。
smoothing的实现
<model-obj src="/model/tree.obj" smoothing> :lights="[ { type: 'HemisphereLight', position: { x: 0, y: -1, z: 0 }, skyColor: 0xaaaaff, groundColor: 0x806060, intensity: 0.2 }, { type: 'DirectionalLight', position: { x: 1, y: -1, z: 1 }, color: 0xffffff, intensity: 0.8 } ]"> </model-obj>
背面还是没光源
<model-obj src="/model/tree.obj" smoothing> :lights="[ { type: 'HemisphereLight', position: { x: 0, y: -1, z: 0 }, skyColor: 0xaaaaff, groundColor: 0x806060, intensity: 0.2 }, { type: 'DirectionalLight', position: { x: 1, y: -1, z: 1 }, color: 0xffffff, intensity: 0.8 } ]"> </model-obj>
背面还是没光源
你可以把灯光添加到摄像机,这样旋转的时候就一直有灯光了