1 创建一个空的canvas

2019-03-07  本文已影响0人  逸崖
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="lib/three.js"></script>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
    </style>
</head>
<body>
    <script>
        var scene = new THREE.Scene(); //场景


        var width = window.innerWidth;
        var height = window.innerHeight;

        
        var renderer = new THREE.WebGLRenderer();
        renderer.setSize(width, height)
        document.body.appendChild(renderer.domElement);

        renderer.render(scene, null);
    </script>
</body>
</html>
init.png
canvas.png
上一篇 下一篇

猜你喜欢

热点阅读