I am working on creating a parallax effect using three.js that responds to mouse movement. My goal is to animate clouds on the x-axis when the mouse is moved.
Initially, I attempted to add images of clouds to the scene. How can I connect the mouse movement event to these cloud images? Or should I consider a different approach for adding clouds to the scene?
This is how I have added clouds:
var imgCloud = new THREE.MeshBasicMaterial({
map:THREE.ImageUtils.loadTexture('img/cloud.jpg')
});
imgCloud.map.needsUpdate = true;
// Cloud
var cloud = new THREE.Mesh(new THREE.PlaneGeometry(200, 200), imgCloud);
cloud.overdraw = true;
scene.add(cloud);