Three.js: Problem with envMap

Created on 19 Dec 2017  Â·  7Comments  Â·  Source: mrdoob/three.js

Description of the problem

i use cubeTexture to load six skybox imgs
and set it to MeshBasicMaterial's envMap

var material = new THREE.MeshBasicMaterial({
       envMap: texture,
       side: THREE.DoubleSide
});

var skyBox = new THREE.Mesh(new THREE.SphereGeometry(2000, 32, 32), material);

it works fine with r86,but makes wrong mapping direction in r89

is there anything changes between the two version ?

and how can i fix the problem?

Three.js version
  • [ ] Dev
  • [x] r89
  • [ ] ...
Browser
  • [ ] All of them
  • [x] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [ ] All of them
  • [ ] Windows
  • [x] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS

All 7 comments

Are you inverting the scale of the object?

Your skybox has an environment map???

Where did you copy that code pattern from?

Kind of makes sense (naming-wise) he wants that texture to be the environment, thus he set the envMap 🤓

I expect there will be users who will need to replace

mesh.scale.x = - 1;

with

mesh.geometry.scale( - 1, 1, 1 );

three.js r.89

hi, thanks for help
i tried to set the scale but got a black screen ...

skyBox.geometry.scale( -1, 1, 1 );

Copy the coding patterns in the three.js examples.

sad t . t

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jack-jun picture jack-jun  Â·  3Comments

clawconduce picture clawconduce  Â·  3Comments

scrubs picture scrubs  Â·  3Comments

boyravikumar picture boyravikumar  Â·  3Comments

seep picture seep  Â·  3Comments