- Home /
Using multiple custom water planes together (Welding multiple planes together)
Okay, so i have a pretty basic script that makes planes have waves on them (I´m using it for a water based game)
function Update () {
var mesh : Mesh = GetComponent.<MeshFilter>().mesh;
var vertices : Vector3[] = mesh.vertices;
for (var i = 0; i < vertices.Length; i++)
{
vertices[i].y += Mathf.Sin(Time.time * speed+ baseHeight[i].x + baseHeight[i].y) * (scale*.5) + Mathf.Sin(Time.time * speed+ baseHeight[i].z + baseHeight[i].y) * (scale*.5);
}
GetComponent.<MeshCollider>().sharedMesh = mesh;
mesh.vertices = vertices;
mesh.RecalculateBounds();
}
The problem is that the plane has a limited size. I can put two planes next to each other but their waves will not connect.
What would be the best way to connect multiple plane vertices together (Or should i just create a custom model and manipulate its vertices)
Answer by callebo_FK · Apr 16, 2018 at 07:32 AM
Answer long overdue but might be nice for someone else finding this.
One solution would be to make a tiling displacement map which you pan for the waves, basically making the waves "loop" so you can have multiple planes next to eachother.
Your answer
Follow this Question
Related Questions
Modifying plane to fit view frustrum issue 0 Answers
Position of Vertices not changing. 1 Answer
Flattening a mesh by deforming it 0 Answers
Pivot modifying script 0 Answers