1. 程式人生 > >【開發總結】—— BABYLON 專案開發必備系列

【開發總結】—— BABYLON 專案開發必備系列

function initHUA(){ function initScene(){ //透明背景 scene.clearColor = new BABYLON.Color4(0, 0, 0, 0); //全部材質可pick scene.meshes.forEach(function(mesh){ mesh.isPickable = true; if(mesh.animations.length){ scene.beginAnimation(mesh, 0, 0, false
) } }); //isready = true; } function initCamera(){ window.camera = new BABYLON.ArcRotateCamera("Camera",0 ,0.8 ,0, new BABYLON.Vector3(0,0,0),scene); //限制範圍 camera.lowerBetaLimit = 0.95; camera.upperBetaLimit = 1.25; //camera.lowerAlphaLimit = -Math.PI / 6;
//camera.upperAlphaLimit = Math.PI / 6; camera.lowerRadiusLimit = 45; camera.upperRadiusLimit = 65; //變焦速度 camera.wheelPrecision = 1; camera.pinchPrecision = 1; camera.zoomOnFactor = 50; ////調整引數 camera.radius = 52; camera.alpha
= 0; camera.beta = 1.25; camera.targetScreenOffset.y = -10; camera.inertia = 0.85; camera.useAutoRotationBehavior = false; scene.activeCamera = camera; camera.attachControl(canvas,true); } function initLight(){ var hem = new BABYLON.HemisphericLight("HemiLight", new BABYLON.Vector3(0, 1, 0),scene); hem.intensity = 0.3; //建立緩衝函式 - Bezier曲線自定義緩衝 //var easingFunction = new BABYLON.BezierCurveEase(.5,.21,.06,.98); }