### barycentric coordinates for quads

by **esmitt** » Fri, 02 Jul 2010 07:50:18 GMT

Hi everyone, some of you know how fill a quads in 2D using barycentric
coordinates?At the present, I'm splitting the quads into 2 triangles,
but that way is inefficient because I have to iterate over the second
bounding box which repeats pixel that were filled previously (by
example, to fill the 2nd triangle I traversed the 1st triangle that
belongs at bounding box formed by 2nd triangle)
Thanks
esmitt

### barycentric coordinates for quads

by **esmitt** » Fri, 02 Jul 2010 07:50:18 GMT

Hi everyone, some of you know how fill a quads in 2D using barycentric
coordinates?At the present, I'm splitting the quads into 2 triangles,
but that way is inefficient because I have to iterate over the second
bounding box which repeats pixel that were filled previously (by
example, to fill the 2nd triangle I traversed the 1st triangle that
belongs at bounding box formed by 2nd triangle)
Thanks
esmitt

### Re: barycentric coordinates for quads

by **Hans-Bernhard Brer** » Fri, 02 Jul 2010 07:55:04 GMT

Am 01.07.2010 00:50, schrieb esmitt:
I think we all know that that's a bad idea, so don't worry about its
implementation too much.
You appear completely confused about the terms you're using. What makes
you think that filling using barycentric coordinates would require a
bounding box?
And while we're at it: what makes you think barycentrics are a useful
tool for a polygon into pixels? They have nothing to do with pixels!

### Re: barycentric coordinates for quads

by **esmitt** » Fri, 02 Jul 2010 08:51:01 GMT

Thanks for your answer.
On Jun 30, 6:55m, Hans-Bernhard Brer < XXXX@XXXXX.COM >
I know that a scanline solution better but for now, I need to use
barycentric coordinates.
Well, when I talk about bounding box is just like a delimiter for my
splitted triangle and iterate over each pixels and decides if (x,y) is
inside..nothing else
I'm using it to make another algorithms

### Re: barycentric coordinates for quads

by **Hans-Bernhard Brer** » Fri, 02 Jul 2010 22:24:25 GMT

Am 01.07.2010 01:51, schrieb esmitt:
How did you arrive at the conclusion that you "need" them? I have to
ask again, because they make no sense whatsoever for the job at hand.
And what would be keeping you from iterating over the bounding box of
the entire quad, and just evaluating
if (pixel_inside_triangle1(x,y) || pixel_inside_triangle2(x,y))
Well, if you're going to loop over pixels in bounding boxes, that
effectively _is_ a scanline algorithm anyway --- so what's keeping you
from using a proper one?

### Similar Threads:

1.barycentric coordinates for quads

Hi everyone, some of you know how fill a quads in 2D using barycentric
coordinates?At the present, I'm splitting the quads into 2 triangles,
but that way is inefficient because I have to iterate over the second
bounding box which repeats pixel that were filled previously (by
example, to fill the 2nd triangle I traversed the 1st triangle that
belongs at bounding box formed by 2nd triangle)
Thanks
esmitt

2.Barycentric coordinates in fragment shader

Hi,
just curious if there's a neat way to get the barycentric coordinates
(or similar) of the current fragment in a GLSL shader?
Only way I could think of it was to render each triangle individually,
but that's not too good for performance...
- Asbjn

3.interpolation of barycentric coordinates

Hello all,
I have points P1, P2 lying in a triangle A, B, C. I'm able to compute
barycentric coordinates of P1 and P2. Is it possible to interpolate
somehow the barycentric coordinates to obtain points which lie on the
line segment P1P2? Of course, I could interpolate linearly between P1
and P2, but I would like to interpolate bar. coordinates instead. Is
that possible?
Thanks.
Jindra

4.To turn barycentric coordinates to the world space

Hi all,
I have a point in barycentric coordinates within a triangle,
I know its vertex (in world coordinates).
It is possible to turn the barycentric coordinates
to the world space?
Thanks in advance !!

5.Barycentric Coordinates on a Cuboid ?

Hi there,
Assume one point is within a cuboid,
The point should be represented by a linear combination of all vertices
of the coboid.
Could someone tell me how to calculate the weight for those vertices?
or any reference paper?
I only know the same case within a convex polygon and a tetrahedron..
subdivide the cuboid into several tetrahedra?
Thanks very much : )
Best Regards,
Brian

6. Barycentric coordinates wrt to > 3 pts

7. interpolating with barycentric coordinates

8. Sprite Vs Quad Screen Coordinates.