0

I have created a sphere and textured image on sphere, var spheregeometry = new THREE.SphereGeometry(2.5,40,40,0,-2*Math.PI,0,Math.PI); These are the parameters used for spheregeometry. radius : 2.5. widthSegments: 40. heightSegments: 40. phiStart: 0. phiLength: (- Math.PI * 2). thetaStart: 0. thetaLength:Math.PI

If i use philength = (-2*Math.PI) the image is textured on sphere, but if i use philength = 2*Math.PI; the image is not textured on sphere, but i want to use philength = 2* Math.PI to texture image on sphere. I don't know how to solve this problem can someone please help me how to solve this problem. I have also uploaded the code.

var spheregeometry = new THREE.SphereGeometry(2.5,40,40,0,-2*Math.PI,0,Math.PI);
var texture = THREE.ImageUtils.loadTexture( path, function() 
{
    texture.minFilter = THREE.NearestFilter;                
    texture.needsUpdate = true;
}); 
var spherematerial = new THREE.MeshBasicMaterial({map: texture});
spherematerial.needsUpdate = true;
var sphere = new THREE.Mesh(spheregeometry, spherematerial);

scene.add(sphere);
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
lakers1234
  • 125
  • 1
  • 2
  • 14
  • The only case I can imagine, when you put negative `phiLength` and see your sphere textured (and don't see it, when `phiLength` is positive), is when your camera is inside of the sphere. If you want to use positive `phiLength`, then try to use `var spherematerial = new THREE.MeshBasicMaterial({map: texture, side: THREE.DoubleSide});` – prisoner849 Jul 05 '17 at 09:43
  • @prisoner849 Thanks a lot finally its working for positive philength. but the image appears mirrored. – lakers1234 Jul 05 '17 at 10:22
  • @prisoner849 if i use var spherematerial = new THREE.MeshBasicMaterial({map: texture, side: THREE.DoubleSide}); image is textured on sphere , but the image is mirrored. – lakers1234 Jul 05 '17 at 10:51
  • read [this](https://stackoverflow.com/a/29975488/4045502) – prisoner849 Jul 05 '17 at 12:40
  • @prisoner849 Thanks a lot finally its working for positive philength and image is also not mirrored. – lakers1234 Jul 05 '17 at 13:04

0 Answers0