#### Archived

This topic is now archived and is closed to further replies.

# Algorithm for interpolation of plane

This topic is 6010 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, Does anyone here have algo to interpolate a n-sided plane in 3D space? Meaning that if I have 4 vertices defining a 4 sided plane in 3D, I need an algo which can generate the in-between points on the plane. Note that the number of vertices must be able to change. Sorry if my desciption is not clear.

##### Share on other sites
first make sure the first 4 points are on the plane.
then,
take three,
generate a normal,
take one of the verticies, dot it with the normal (same result for any vertex if your normal is correct)
then whack it into the forumula:

ax.nx+by.ny+cz.nz=d

where d is the dot of the normal and vertex vector. and n is the normal, and a,b,c are values you can guess relative to the verticies you already have. (ie, guess a,b, generate c)

any resulting vertex (a,b,c) will be on the plane. Note that a plane is infinite though. you''ll have to generate planes along the edges to check that the new verticies are enclosed.

##### Share on other sites
or, just place a new vertex in the center of the previous for thus creating 4 new quads on the plane. doing this recursivly will result in higher and higher polygons counts with evenly spaced vertices and even perserves correct texture coordintes.

this wont work for arbitrary onjects well since it does not handle smoothing via normals (planes have the exact same normal for ALL vertices on the plane by the defination of a plane). there are ways to do this as well, however i dont know an easy way to explain it (since i never coded such a function). the basic idea is to find a vertex in the center of the poly, then use the normals to help "offset" the vertex so that it goes along with the normals of the vertices that helped create the new vertex. repeated use of this results in a somewhat smoother model and is basically what ati trueform enabled cards (like the radeon 8500) do in hardware.

its also the basic of how LOD algos work. except since you need to be more efficent with the increasing of vertices (or decreasing) you have to have threshholds based on changes of the normals vs area of the surface, etc.

however, since you said "n-sided" plane, i am not sure if you know what plane is. please try to elaborate on what your are trying to do.

##### Share on other sites
My mistake .. what i meant is a n-sided polygon on a 3D plane... i need to generate the in-between vertices so that i can set individual normals for them... sorry if my description confuses any of you....

Thanks again

##### Share on other sites
you want to do some research on tessalation, a topic that will rely on recursion, so make sure you understand that well. also make sure you understand normals and how to calculate them.

1. 1
Rutin
27
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633313
• Total Posts
3011315
• ### Who's Online (See full list)

There are no registered users currently online

×