I've been experimenting with creating a moving blue grid effect in three.js, where the grid appears to be continuously advancing forward as if approaching the sun. I haven't been able to find any examples on how to achieve this specific effect. Something similar to what is shown in this GIF:
One approach I tried involves using the following code:
lines1.position.z = Math.cos( time ) * 0.75 + 1.25;
This snippet showcases the creation of the grid using THREE.Line:
for (var i = -size; i <= size; i+=steps)
{
geometry.vertices.push(new THREE.Vector3(-size, - 0.10,i));
geometry.vertices.push(new THREE.Vector3(size, -0.10,i));
geometry.vertices.push(new THREE.Vector3(i, - 0.10,-size));
geometry.vertices.push(new THREE.Vector3(i, - 0.10,size));
}
var lines1 = new THREE.Line(geometry, material, THREE.LineSegments)
scene.add(lines1);