vendredi 8 mai 2015

Texture mapping problems in three.js

Hey guys so im trying to correctly map a texture to a 3d object in three.js. I'm using Cinema4D to create my objects then exporting to colada then re-exporting from maya as a .js object. The texture is baked out in C4D as a jpg.

Here is what everything looks like: http://ift.tt/1bDV5hU

And here is the code I'm using:

var floorDiskmaterial = new THREE.MeshPhongMaterial({
    map: THREE.ImageUtils.loadTexture('img/testColor.jpg'),
    transparent: true,
    color: 0xeaeaea,
    ambient: 0x062537,
    specular: 0x6a3e6d,
    shading: THREE.FlatShading,
    fog: false,
    shininess: 50,
});

loader.load( "models/test2.js", function( geometry ) {
    FloorDiskFire = new THREE.Mesh( geometry, floorDiskmaterial);
    FloorDiskFire.position.set(0,0.2,0);
    FloorDiskFire.castShadow = true;
    FloorDiskFire.receiveShadow = true;
    FloorDiskFire.scale.set(1.5,1.5,1.5);
    //FloorDiskFire.rotation.y = -0.78;
} );




Aucun commentaire:

Enregistrer un commentaire