美文网首页
1 创建一个空的canvas

1 创建一个空的canvas

作者: 逸崖 | 来源:发表于2019-03-07 14:39 被阅读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

相关文章

网友评论

      本文标题:1 创建一个空的canvas

      本文链接:https://www.haomeiwen.com/subject/sqmcpqtx.html