# Splitting and sharing vertices data from parent to child

I have a quad with noise applied for the terrain. When I split the parent’s quad into children how do I pass the vertices from the parents to each child so that each child gets a sampling of the noise to rebuild the terrain?

The noise I want to use is Perlin noise or Simplex noise. My quadtress algorithm starts with a parent plane object who’s width and height = 1000x1000 and tessellation width and height = 2000x2000. The plane checks if the distance from the camera is less than some threshold. If it is less than the threshold I add 4 new plane objects with half the parent’s width and height and 2x its parent’s tessellation to the scene. I need the noise that’s applied to the parent broken up into 4 sections. One section for each child.

the vertices should be distributed from parent to child like so: This is a VERY basic example of what I have tried (pseudo-code):

Here I create a plane and add noise to the center

``````let n = 2
var color = 'blue'
var geometry = new THREE.PlaneBufferGeometry( n, n, n, n );
var material = new THREE.MeshBasicMaterial({color: color, wireframe: true});
var terrain = new THREE.Mesh( geometry, material );

let v3 = new THREE.Vector3();
let pos = terrain.geometry.attributes.position;

for(let i = 0; i < pos.count; i++){
v3.fromBufferAttribute(pos, 4);
v3.z = 2
pos.setXYZ(4, v3.x, v3.y, v3.z);
pos.needsUpdate = true;
}
``````

Then I hard code the positions of the first quad I’m looking for and save that to an array

``````let t = []
for(let i = 0; i < pos.count; i++){
v3.fromBufferAttribute(pos, i);
if (i<= n/2){
t.push(v3.clone())
}
if(i==3 || i ==4){
t.push(v3.clone())
}
}
``````

Next, I create a child for the first quad of the parents and apply the save vertices from the parents.

``````var color = 'black'
var geometry = new THREE.PlaneBufferGeometry( 1, 1, 1, 1 );
var material = new THREE.MeshBasicMaterial({color: color, wireframe: true});
var terrain = new THREE.Mesh( geometry, material );

let v3_ = new THREE.Vector3();
let pos_ = terrain.geometry.attributes.position

for(let i = 0; i < pos_.count; i++){
v3_.fromBufferAttribute(pos_, i);
v3_ = t[i]
pos_.setXYZ(i, v3_.x, v3_.y, v3_.z);
pos_.needsUpdate = true;
}
``````

This wouldn’t work because I need the child’s tesselation to be 2X that of its parent. The way that I’m going about solving this problem might don’t be the correct direction any advice would help

I think the solution would be to convert the noise to texture and divide the texture