THREE.js - Can't load texture locally

后端 未结 4 1853
一向
一向 2020-12-04 00:06

I have a local file in which I try to load texture like this:

var texture = THREE.ImageUtils.loadTexture( \'image.jpg\' );
var cubeGeo = new THREE.CubeGeomet         


        
4条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 00:23

    To further explain (because I was confused as well), you can install a local server (I used node - http://nodejs.org/download/ to download node).

    After, to install server cd to your project directory and run in command line:

    npm install http-server -g

    To run:

    http-server

    Then go to the default local page

    http://localhost:8080/

    and you should see your project there.

提交回复
热议问题