Sign in to follow this  
wildboar

Can someone pls explain about barycentric coords

Recommended Posts

wildboar    320
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this