[SOLVED] How can I create a smooth plane/surface from a set of points? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

[SOLVED] How can I create a smooth plane/surface from a set of points?

Say the plane is represented by a two dimensional array whose elements contain the height of each vertex. How can I initialize it with a smaller array and smoothen out the values in between? Solution: https://code.sololearn.com/WWS3bPM44Y0T/?ref=app

27th Dec 2019, 6:22 AM
Moses Odhiambo
Moses Odhiambo - avatar
3 Answers
+ 5
The smoothening part is called "interpolation". There are multiple ways to fill in the gaps (bilinear being the simplest) but your image looks like bicubic interpolation to me. You might want to solve the simpler problem of interpolating a 1D function first (like, plotting a graph with x and y). 1D linear interpolation is just drawing a straight line between two neighboring points, 1D cubic interpolation requires some more maths. After that, 2D should be easy.
27th Dec 2019, 10:00 AM
Schindlabua
Schindlabua - avatar
+ 5
ChillPill🥇pro🥇 averaging the points makes the surface rugged - bicubic interpolation seems to work best .
27th Dec 2019, 10:44 AM
Moses Odhiambo
Moses Odhiambo - avatar
27th Dec 2019, 9:29 AM
Prashanth Kumar
Prashanth Kumar - avatar