0

I am making a wormhole of sorts with a cylinder and a rotating texture.

See here: http://learningthreejs.com/blog/2012/01/11/tunnel-effect/

Now I have the texture rotate like this...

 tunnel.material.map.offset.y += 0.01;
 tunnel.material.map.offset.x += 0.005;

This works fine until I add my alpha map ( want to see through gaps in the tunnel ).

I thought I could just do the same like so...

tunnel.material.alphaMap.offset.y += 0.01;
tunnel.material.alphaMap.offset.x += 0.005;

Unfortunately this didn't work - no effect...and rotating the cylinder instead will not lead to the desired results.

Michael Paccione
  • 2,467
  • 6
  • 39
  • 74

1 Answers1

1

Ah it turns out I had clamped the edges on the main texture but forgot to do it on the alpha texture. It works as expected and is straightforward;

var cylTexture = loader.load("wormhole.jpg"),
        cylAlpha = loader.load("wormholeAlpha2.jpg");
        cylTexture.wrapT = THREE.RepeatWrapping;
        cylTexture.wrapS = THREE.RepeatWrapping;
        cylAlpha.wrapT = THREE.RepeatWrapping;
        cylAlpha.wrapS = THREE.RepeatWrapping;
Michael Paccione
  • 2,467
  • 6
  • 39
  • 74