• Advertisement
Sign in to follow this  

Can someone pls explain about barycentric coords

This topic is 2450 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

I am getting the newly created vertices from the fixed function tessellator, they are using barycentric UVW coords.
This is supposed to transform patch space vertices to clip space. The code works but I want to understand how its done.
the tessCoord is supposedly the new position of the generated vertex and the gl_in.pos variables are the original control points of the patch.

[source]
vec4 p0 = gl_TessCoord.x * gl_in[0].gl_Position;
vec4 p1 = gl_TessCoord.y * gl_in[1].gl_Position;
vec4 p2 = gl_TessCoord.z * gl_in[2].gl_Position;
vec4 position = p0 + p1 + p2;

position *= WVP; //To clip space
[/source]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement