我想创建一个旭日图,对应于以下内容:
在哪里:
我查看了情节文档,但提供的示例仅使用数据集或参数values,我不明白它是如何工作的。
有人有一个我可以信赖的、与我正在寻找的类似的例子吗?
由于此错误,我无法执行我的代码:
TypeError: THREE.Scene is not a constructor
Run Code Online (Sandbox Code Playgroud)
我使用官方 github 存储库中的three.js 文件,这里是我的文件:
索引.html
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../style.css">
<title>First three.js</title>
</head>
<body>
<script type="module" src="../frontend/tetrahedrons_render.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
四面体_render.js
import * as THREE from '../lib/three.js';
// Create the scene
const scene = new THREE.Scene();
scene.background = new THREE.Color(0x2d3436);
// Set up the camera
const camera = new THREE.PerspectiveCamera(100, window.innerWidth / window.innerHeight, 0.1, 1000);
// Set up the render
const renderer = new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight); …Run Code Online (Sandbox Code Playgroud)