I'm working on my first project with Three.js and I'm hitting against a wall right now.
I would like to know what would be the best way to make an animated (low-poly) sea inside Three.js , I've been trying since yesterday with displacementMaps but I have been reading that displacementMaps can't be animated ? (is that true ?)
var faceGeo = new THREE.PlaneGeometry(200,200,subdivisions,subdivisions);
var faceMat = new THREE.MeshPhongMaterial({color: 0xeeeeee, side: THREE.DoubleSide,transparent: true,opacity: .3,specular: 0x333333,shading: THREE.FlatShading})
var face1 = new THREE.Mesh(faceGeo,faceMat);
face1.rotation.x = -(Math.PI /2);
face1.position.y = -30
face1.position.z = -90
textureDiff.load("_textures/dispmap_sea.png",function(image){
image.wrapS = THREE.RepeatWrapping;
image.wrapT = THREE.RepeatWrapping;
image.repeat = new THREE.Vector2(1,1);
image.anisotropy = renderer.getMaxAnisotropy();
face1.material.displacementMap = image;
face1.material.displacementScale = 10;
});
in update
displacementPos++;
face1.material.displacementMap.offset = new THREE.Vector2(displacementPos,displacementPos);
face1.material.needsUpdate = true;
face1.material.displacementMap.needsUpdate = true;
It would be the easiest way but if it is impossible, I don't know what my other options are.
Thank you for your help. A Three.js amateur and enthusiast.