Jump to content
  • Advertisement

Archived

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

Lipofuse

Algorithm for interpolation of plane

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!