1

I'm trying to render a texture, eventually as a bump map but for now I'd just like to get it visible.

function setTexture() {
  var material;
  var texture = new THREE.DataTexture( signeddata, 1000, 615, THREE.RGBAFormat );
  texture.needsUpdate = true;
  var material = new THREE.MeshBasicMaterial( { map: texture } );
  cube = new THREE.Mesh(new THREE.CubeGeometry(1000, 615, 10), material);
  cube.overdraw = true;
  scene.add(cube);
}

signeddata is an array of unsigned ints. All I get is a white cube and a bunch of type errors. If I set it up like this. I know signeddata is correct data, and its been initialized as a Uint8Array.

Any help is appreciated.

4

0 回答 0