Custom sphere for video texture

video-texture

#1

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 );


            }

#2

First, you should ensure that your model is displayed correctly without a video texture. If this is the case, you can try to apply the texture on the respective material.

Besides, it will be much easier to help you if provide a running live example that shows your current progress.


#3

There are also two other examples which illustrate the usage of video textures:

https://threejs.org/examples/#webgl_materials_video
https://threejs.org/examples/#webgl_video_panorama_equirectangular