Re: Barycentric to cartesian?




"Kaba" <none@xxxxxxxx> wrote in message
news:MPG.22eeba963e34b3f19896d5@xxxxxxxxxxxxxxxxx
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.

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.

Regards,
Ron Francis
www.RonaldFrancis.com





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

.



Relevant Pages

  • Re: intersection between a line segment and a triangle
    ... I'm searching an algorithm to compute the intersection between a ... line segment and a triangle in 2D (I've already found some algos for the 3D ... Think of it, just folding in two a simple sheet of paper, to prevent self intersection, ...
    (comp.graphics.algorithms)
  • Re: How to get 3D coordinates from screen coordinates?
    ... > returned barycentric coordinates of the intersection and the three ... > points that make up the triangle. ... The point of intersection for U,V ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: How to get 3D coordinates from screen coordinates?
    ... The point on the intersected triangle is easily calculated from the returned ... The point of intersection for U,V coordinates ... > triangles of that rectangle, I'm not sure if it is the best way. ... I'm using the barycentric coordinates of the ...
    (microsoft.public.win32.programmer.directx.managed)
  • Re: Hot to get exactly hit point in Pick?
    ... returned the triangle index and a pair of barycentric coordinates. ... through the vertex buffer/index buffer for your mesh to identify the three ... > Could I get exactly hit point in this triangle? ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: vector analysis example question
    ... case the triangle they form). ... The barycentric coordinates of the midpoint of ... t = 0.5 and you have the midpoint. ... and V' = vector parallel to the ...
    (sci.math)