three制作一个立方体扭转动画效果代码

代码语言:html

所属分类:三维

代码描述:three制作一个立方体扭转动画效果代码

代码标签: 立方体 扭转 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<html lang="en">
<head>

    <meta charset="UTF-8">





</head>

<body>

    <canvas id="canvas-container" width="400" height="448" style="width: 320px; height: 359px;"></canvas>


    <script type="module">
        import anime from "https://cdn.skypack.dev/animejs";
        import {
            AmbientLight,
            BoxBufferGeometry,
            Color,
            DirectionalLight,
            Mesh,
            MeshLambertMaterial,
            PCFSoftShadowMap,
            PerspectiveCamera,
            PlaneBufferGeometry,
            Scene,
            sRGBEncoding,
            WebGLRenderer,
        } from "https://cdn.skypack.dev/three";
        import {
            OrbitControls
        } from "https://cdn.skypack.dev/three/examples/jsm/controls/OrbitControls";

        const addDesktopControls = (camera, renderer) => {
            const orbitControls = new OrbitControls(camera, renderer.domElement);
            orbitControls.update();
            return {
                orbitControls,
            };
        };

        class Sketch {
            constructor({
                canvasEl
            }) {
                this.canvasEl = canvasEl;
         .........完整代码请登录后点击上方下载按钮下载查看

网友评论0