Não é mais possível fazer postagens ou usar assinaturas novas da Usenet nos Grupos do Google. O conteúdo histórico continua disponível.
Dismiss

Barycentric to cartesian?

855 visualizações
Pular para a primeira mensagem não lida

Ron Francis

não lida,
21 de jul. de 2008, 01:29:0621/07/2008
para
Hi,

When finding an intersection of a line and a triangle I find the point on
the plane and then determine if it is in the triangle.
I have been reading some stuff which id supposed to do it more efficiently,
but it leaves me with barycentric coordinates (t,u,v).
I haven't used these before and couldn't find any information on converting
back to cartesian.
Sorry if this is a stupid question, but is it possible?
If so, how can I do it?

Regards,
Ron Francis
www.RonaldFrancis.com


-- Posted on news://freenews.netfront.net - Complaints to ne...@netfront.net --

Vince Hradil

não lida,
21 de jul. de 2008, 09:18:5821/07/2008
para

Kaba

não lida,
21 de jul. de 2008, 09:24:4321/07/2008
para
Ron Francis wrote:
> When finding an intersection of a line and a triangle I find the point on
> the plane and then determine if it is in the triangle.
> I have been reading some stuff which id supposed to do it more efficiently,
> but it leaves me with barycentric coordinates (t,u,v).
> I haven't used these before and couldn't find any information on converting
> back to cartesian.
> Sorry if this is a stupid question, but is it possible?
> If so, how can I do it?

Your choice of names for the ordinates suggests you are actually using
the Moller-Trumbore ray-triangle intersection algorithm. In that case,
(t, u, v) are not barycentric coordinates. The barycentric coordinates
are (u, v, 1 - (u + v)), while t is the parameter of the ray. You can
use either to get the point of intersection (t is along the ray, the
barycentric coordinates are along the triangle). Barycentric coordinates
are useful to interpolate values along the triangle, position being just
one example.

--
http://kaba.hilvi.org

Ron Francis

não lida,
22 de jul. de 2008, 02:04:4422/07/2008
para

"Kaba" <no...@here.com> wrote in message
news:MPG.22eeba963...@news.cc.tut.fi...

Kaba,
Thanks for responding.
My apologies, you are right, I was looking at the Moller-Trumbore algorithm
and with a little further study I found that 't' wasn't one of the
coordinates.
In the case of intersecting a triangle with a ray, it is simple for me to
use 't' to find the Cartesian point because I already have the origin and
vector, however I'm also thinking ahead to textures on triangles that change
shape, interpolating normals when looking at a pixel in a triangle for
reflections etc., so this has created some interest for me in the
barycentric system.
So, even though my original question is no longer urgent, I am still
interested in knowing how to convert from barycentric to cartesian if, for
example, I have a triangle vertices A,B,C, and barycentric coordinates (u,
v, 1 - (u + v))?

I must warn you though that maths is not one of my strong points, especially
converting from notation to algorithm, but I try.

Ron Francis

não lida,
22 de jul. de 2008, 02:13:5122/07/2008
para
"Vince Hradil" <hra...@yahoo.com> wrote in message
news:40641e3a-0714-4eeb...@2g2000hsn.googlegroups.com...

On Jul 21, 12:29 am, "Ron Francis" <ronfran...@adam.com.au> wrote:
> Hi,
>
> When finding an intersection of a line and a triangle I find the point on
> the plane and then determine if it is in the triangle.
> I have been reading some stuff which id supposed to do it more
> efficiently,
> but it leaves me with barycentric coordinates (t,u,v).
> I haven't used these before and couldn't find any information on
> converting
> back to cartesian.
> Sorry if this is a stupid question, but is it possible?
> If so, how can I do it?

Does wikipedia help:

Thanks Vince,
I hadn't seen the one on trilinear before.
It certainly helps me understand more, but writing an algorithm to convert
to cartesian is still out of my grasp.
Cheers.

Regards,
Ron Francis
www.RonaldFrancis.com


-- Posted on news://freenews.netfront.net - Complaints to ne...@netfront.net --

Kaba

não lida,
22 de jul. de 2008, 04:44:5122/07/2008
para
Ron Francis wrote:
> So, even though my original question is no longer urgent, I am still
> interested in knowing how to convert from barycentric to cartesian if, for
> example, I have a triangle vertices A,B,C, and barycentric coordinates (u,
> v, 1 - (u + v))?

A barycentric triple (u, v, w), u + v + w = 1, has no meaning in itself,
you also need to know how these are related to the points. This relation
is defined by the one deriving the algorithm.

For example, it could be stated that a point P on the triangle ABC
satisfies:

P = uA + vB + wC

Given this relation, the conversion to cartesian is directly given. You
need to take a look at the paper or book you are using to get the
missing part of the barycentric coordinate definition.

--
http://kaba.hilvi.org

Ron Francis

não lida,
22 de jul. de 2008, 09:02:4522/07/2008
para
"Kaba" <no...@here.com> wrote in message
news:MPG.22efca82f...@news.cc.tut.fi...

> For example, it could be stated that a point P on the triangle ABC
> satisfies:
>
> P = uA + vB + wC
>
> Given this relation, the conversion to cartesian is directly given.

Oh, is it that easy?
I couldn't see the forest for the trees.
Thanks Kaba, much appreciated.

Kaba

não lida,
22 de jul. de 2008, 10:32:2222/07/2008
para
Ron Francis wrote:
> Oh, is it that easy?
> I couldn't see the forest for the trees.
> Thanks Kaba, much appreciated.

You're welcome. Very nice paintings on your site.

--
http://kaba.hilvi.org

Ron Francis

não lida,
22 de jul. de 2008, 20:53:5122/07/2008
para
"Kaba" <no...@here.com> wrote in message
news:MPG.22f01bee...@news.cc.tut.fi...

> Ron Francis wrote:
>> Oh, is it that easy?
>> I couldn't see the forest for the trees.
>> Thanks Kaba, much appreciated.
>
> You're welcome. Very nice paintings on your site.

Thanks for noticing.

Interesting problem you have at your site with the resampling of 100 x 100
pixels.
That's got me thinking.

Cheers.

0 nova mensagem