lemon_babylon_3dmax

功能描述

Babylonjs模型3D设计,让HTML5可以开发3D效果,并支持 3DMax 大型3D渲染

依赖的插件

Babylonjs

快速使用

    <script src="./script/babylon.custom.js"></script>
    <canvas id="renderCanvas" touch-action="none"></canvas>
    <script type="text/javascript">
    
        var createScene = function () {
        
            var scene = new BABYLON.Scene(engine);
            var camera = new BABYLON.ArcRotateCamera("Camera", 0, 0, 3, BABYLON.Vector3.Zero(), scene);
            camera.attachControl(canvas, true);
            camera.useAutoRotationBehavior = true;
            camera.autoRotationBehavior.idleRotationSpeed = 1; //自动旋转速度
            camera.autoRotationBehavior.idleRotationWaitTime = 1000; //用户交互后多少时间开启自动旋转(毫秒)
            camera.autoRotationBehavior.idleRotationSpinupTime = 1000; //从开始自动旋转到设置的旋转速度所需要的时间(毫秒)
            camera.autoRotationBehavior.zoomStopsAnimation = true; //设置缩放是否会停止自动旋转
        
            var light1 = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(1, 1, 0), scene);
            var light2 = new BABYLON.PointLight("light2", new BABYLON.Vector3(0, 1, -1), scene);
        
            var sphere = BABYLON.MeshBuilder.CreateSphere("sphere", {}, scene);
        
            return scene;
        
        };
    
    
        var demo = {
            constructor: createScene,
            onload: function () {
            }
        };
    </script>

特别说明

使用本插件注意会与同Babylonjs插件冲突,请开发者谨慎选择,本插件为1.0版本,后续会陆续更新。
是否仍需要帮助? 请保持联络!
最后更新于 2024/11/18