我是 Three.js 的新手,所以我问了一个基本问题。我无法在球体上加载纹理。它在函数 createEarthMaterial 中。我的带有纹理的图像称为“map2.png”。我几乎尝试了一切。我的代码来自“Three.js Essentials”一书,但它不起作用。你能给出任何好的解决方案吗?提前致谢。这是代码:
// global variables
var renderer;
var scene;
var camera;
var control;
var stats;
var cameraControl;
/**
* Initializes the scene, camera and objects. Called when the window is
* loaded by using window.onload (see below)
*/
function init() {
// create a scene, that will hold all our elements such as objects, cameras and lights.
scene = new THREE.Scene();
// create a camera, which defines where we're looking at.
camera = new THREE.PerspectiveCamera(45, window.innerWidth …Run Code Online (Sandbox Code Playgroud)