Hi,
I am having a gltf model of a car. I need to set the car model like to move on the ground texture. I already tried this following this example . But in this the ground mesh is just grid helper. But, I am facing a lagging issue in the ground texture, When I tried this using planegeometry with a texture. I am using following script for ground texture
var groundTexture = new THREE.TextureLoader().load( "models/texture/floor_tiles.jpg" );
groundTexture.wrapS = groundTexture.wrapT = THREE.RepeatWrapping;
groundTexture.repeat.set( 75, 75 );
groundTexture.anisotropy = 64;
groundTexture.encoding = THREE.sRGBEncoding;
var groundMaterial = new THREE.MeshStandardMaterial( { map: groundTexture } );
var mesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 100, 100 ), groundMaterial );
mesh.position.y =0.0;
mesh.rotation.x = - Math.PI / 2;
mesh.receiveShadow = true;
scene.add( mesh );
But It doesn’t give me a good smooth flow while animating it. I am using following code to animate the floor.
var animate = function () {
requestAnimationFrame( animate );
var time = -performance.now() / 1000;
mesh.position.z = ( time ) % 8;
renderer.render( scene, camera );
};
How to get this animated floor without lagging?