Hello guys!
I’am trying to create a sphere from a fbs, 3ds, json formats and to put a video texture on it. Is it real? Can someone give me some advice where should I start from. I don’t see much info about that. For now I’am trying to put geometry of object into mesh. And then add mesh to the scene.
So the task is to replace new THREE.SphereGeometry( 500, 60, 40 ) with the geometry of my file.
Also tried to play with scale, light. Nothing happend. I’am using this example
Best wishes, Arsenij
// video
video = document.createElement( 'video' );
video.loop = true;
video.muted = true;
video.src = 'textures/MaryOculus.webm';
video.setAttribute( 'webkit-playsinline', 'webkit-playsinline' );
video.play();
texture = new THREE.VideoTexture( video );
texture.minFilter = THREE.NearestFilter;
texture.maxFilter = THREE.NearestFilter;
texture.format = THREE.RGBFormat;
texture.generateMipmaps = false;
scene = new THREE.Scene();
scene.background = new THREE.Color( 0x101010 );
var loader = new THREE.FBXLoader();
loader.load( 'models/xsi_man_skinning.fbx', handle_load);
function handle_load(geometry, materials) {
geometry.scale(-1, 0, 0 );
var uvs = geometry.faceVertexUvs[ 0 ];
for ( var i = 0; i < uvs.length; i ++ ) {
for ( var j = 0; j < 3; j ++ ) {
uvs[ i ][ j ].x *= 0.5;
}
}
var material = new THREE.MeshBasicMaterial( {
map: texture,
wireframe: true
} );
var mesh = new THREE.Mesh( geometry, material );
mesh.rotation.y = - Math.PI / 2;
mesh.layers.set( 1 ); // display in left eye only
scene.add( mesh );
}