I'm currently developing a car game using THREE.js. I've encountered an issue where I have created a road using Plane geometry and placed the car on it. Now, I have also made a terrain but am unsure of how to link the car to the road so that it moves on top of the road's surface, similar to real life.
I attempted to address this problem by calculating the height of the vertices on the plane and positioning the car above that height, however, this approach has not been successful for me as shown in the code snippet below.
for(var k = 0; k < ground.geometry.vertices.length; k++){
localObject.position.y = ground.geometry.vertices[k].y + 1;
}
I would greatly appreciate any assistance on this matter.