f



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
0
jparus (92)
4/12/2008 1:39:18 PM
comp.graphics.algorithms 6674 articles. 0 followers. Post Follow

4 Replies
358 Views

Similar Articles

[PageSpeed] 8

On Apr 12, 3:39 pm, jindra <jpa...@gmail.com> wrote:
> 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?
>

It's exactly the same thing. The barycentric coordinates computed from
any triangle or generic cartesian coordinates are related to one
another by an affine transformation.
0
gatti1 (74)
4/12/2008 4:36:04 PM
On Apr 12, 6:36 pm, Lorenzo Gatti <ga...@dsdata.it> wrote:
> On Apr 12, 3:39 pm, jindra <jpa...@gmail.com> wrote:
>
> > 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?
>
> It's exactly the same thing. The barycentric coordinates computed from
> any triangle or generic cartesian coordinates are related to one
> another by an affine transformation.

I'm sorry, but I don't follow now. You suggest to linearly interpolate
the barycentric coordinates? Eg., let's have (u1,v1,w1) as
barycentric coordinates of P1, and (u2, v2, w2) as barycentric
coordinates of P2 (with respect to some triangle A, B, C). I'm looking
for a function f(t) which for a given t returns barycentric
coordinates (u_t, v_t, w_t) so that A*u_t + B*v_t + C*w_t = Q, where Q
is a point on the line P1, P2.

Jindra
0
jparus (92)
4/13/2008 7:17:24 AM
> I'm sorry, but I don't follow now. You suggest to linearly interpolate
> the barycentric coordinates? Eg., let's have (u1,v1,w1) as
> barycentric coordinates of P1, and (u2, v2, w2) as barycentric
> coordinates of P2 (with respect to some triangle A, B, C). I'm looking
> for a function f(t) which for a given t returns barycentric
> coordinates (u_t, v_t, w_t) so that A*u_t + B*v_t + C*w_t = Q, where Q
> is a point on the line P1, P2.

It's correct. Consider

P1 = u1 * A + v1 * B + w1 * C
u1 + v1 + w1 = 1
P2 = u2 * A + v2 * B + w2 * C
u2 + v2 + w2 = 1

Q = P(t) = (1 - t)P1 + tP2 =
((1 - t)u1 + tu2) * A + 
((1 - t)v1 + tv2) * B +
((1 - t)w1 + tw2) * C

Checking:

(1 - t)u1 + tu2 + 
(1 - t)v1 + tv2 +
(1 - t)w1 + tw2
=
(1 - t)(u1 + v1 + w1) +
t(u2 + v2 + w2)
= (1 - t) + t = 1

-- 
kaba.hilvi.org
0
none87 (1162)
4/13/2008 9:55:44 AM
On Apr 13, 11:55 am, Kaba <n...@here.com> wrote:
> > I'm sorry, but I don't follow now. You suggest to linearly interpolate
> > the barycentric coordinates? Eg., let's have (u1,v1,w1) as
> > barycentric coordinates of P1, and (u2, v2, w2) as barycentric
> > coordinates of P2 (with respect to some triangle A, B, C). I'm looking
> > for a function f(t) which for a given t returns barycentric
> > coordinates (u_t, v_t, w_t) so that A*u_t + B*v_t + C*w_t = Q, where Q
> > is a point on the line P1, P2.
>
> It's correct. Consider
>
> P1 = u1 * A + v1 * B + w1 * C
> u1 + v1 + w1 = 1
> P2 = u2 * A + v2 * B + w2 * C
> u2 + v2 + w2 = 1
>
> Q = P(t) = (1 - t)P1 + tP2 =
> ((1 - t)u1 + tu2) * A +
> ((1 - t)v1 + tv2) * B +
> ((1 - t)w1 + tw2) * C
>
> Checking:
>
> (1 - t)u1 + tu2 +
> (1 - t)v1 + tv2 +
> (1 - t)w1 + tw2
> =
> (1 - t)(u1 + v1 + w1) +
> t(u2 + v2 + w2)
> = (1 - t) + t = 1
>
> --
> kaba.hilvi.org

Very nice, thank you very much.

Jindra
0
jparus (92)
4/13/2008 1:00:19 PM
Reply:

Similar Artilces:

interpolating with barycentric coordinates
Peter Shirley's book ("Fundamentals of Computer Graphics") discusses color interpolation via barycentric coordinates. It also says: "we can use the barycentric coordinates to interpolate the depth values of the vertices to each pixel." Is this correct though? I thought some special perspective correct interpolation had to be done. > Peter Shirley's book ("Fundamentals of Computer Graphics") discusses color > interpolation via barycentric coordinates. It also says: "we can use the > barycentric coordinates to interpolate the depth values of the vertices to > each pixel." Is this correct though? I thought some special perspective > correct interpolation had to be done. Yes, it is correct. This has been discussed before, and just recently. In short, the 'depth' values that are used with z-buffer have a special computation formula which has this nice property. Of course, this formula is deliberately chosen such. Quoting myself: "The projected points all lie on a plane, so the notion of depth is added afterwards. What should we qualify as a "depth" value? Distance of the 3d-point to the center of projection? Orthogonal distance of the 3d- point to the projection plane? These are the easy ones that come to mind first. There are an infinity of others. However, all discussion is without a meaning without a purpose to actually use the depth value somewhere. The purpo...

Interpolation algorithm
Given a set of 3D data z_i(x_i,y_i), where the 2D points (x_i,y_i) are random (by random I mean they are not distributed on a nice uniform grid), is there a standard algorithm for converting/interpolating the data to a uniform grid (x_i,y_i)? Thanks, David "David Ananas" <whatafish@hotmail.com> wrote in message news:1f57124c.0310221255.72b9c515@posting.google.com... > Given a set of 3D data z_i(x_i,y_i), where the 2D points (x_i,y_i) are > random (by random I mean they are not distributed on a nice uniform > grid), is there a standard algorithm for converting/interp...

Interpolation algorithm
Hello, I have a report that contains a graph plotted with gnuplot script: ...... ...... set pm3d at b interpolate 100,100 set cbrange[0.8*a:a] set view map set palette maxcolors 4 splot 'field.txt' matrix using ($1*10):($2*10):($3) with pm3d notitle I need to describe the interpolation algorithm for this graph in report. Where can I find information about this algorithm? Thanks. Michael > I have a report that contains a graph plotted with gnuplot script: > > ..... > ..... > set pm3d at b interpolate 100,100 > set cbrange[0.8*a:a] > set view map > set palette maxcolors 4 > splot 'field.txt' matrix using ($1*10):($2*10):($3) with pm3d notitle > > I need to describe the interpolation algorithm for this graph in report. Where > can I find information about this algorithm? Read this: help pm3d --- PM ...

Barycentric coordinates
I'd like to draw a triangle and mark a point P in it with barycentric coordinates (3/4,1/6,1/12). How to do this with Maple? Best regards, Rainer Rosenthal r.rosenthal@web.de Perhaps this will do for you. > restart: > with(plots): > P[1],P[2],P[3]:=[3,5],[-1,4],[7,-3]: > B:=[3/4,1/6,1/12]: > C:=add(B[i]*P[i],i=1..3): > > T:=plot([P[1],P[2],P[3],P[1]], style=line, color=red, scaling = constrained,axes=normal): > Pt:=plot([C], style=point,symbol=circle,color=blue): > Text:=textplot([op(C+[-.2,.2]),convert(B,string)],align={ABOVE,RIGHT}): > &...

Interpolation with coordinates
Dear Matlab users, I have four sets of data, (u1,v1), (u2,v2), (u3,v3) and (u4,v4) located at coordinates (x1,y1), (x2,y2), (x3,y3) and (x4,y4). I would like to obtain a new set of data (u0,v0) at given coordinates (x0,y0) using a bilinear interpolation. I guess it has to do with interp2, but I can't figure out exactly how to do it, Thank you very much for your help, Regards Jose "Jose Miguel " <josemijauregui@hotmail.com> wrote in message <jpvov1$ae2$1@newscl01ah.mathworks.com>... > Dear Matlab users, > > I have four sets of data, (u1,v1), (...

Graphic and coordinate system
How do I transform my values into my coordinate system All values is in pixels In my coordinate system origo is located in (40,495) The display area that I can use is from X=40 to x=750 and from y=495 to y=55 When you go down in the coordinate system the y value is increasing and when you go to the right the x value is increasing. The y-axis is showing time from 12:00 to 20:00 hours and the x-axis is showing from 0 to 800 So I can have values like [13:10, 190] [13:40, 240] [14:25, 390] [15:10, 431] [16:10, 554] [17:10, 643] [18:10, 740] I just wonder if someone has a ...

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 Am 01.07.2010 00:50, schrieb esmitt: > Hi everyone, some of you know how fill a quads in 2D using barycentric > coordinates? I think we all know that that's a bad idea, so don't worry about its implementation too much. > 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) 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! Thanks for your answer. On Jun 30, 6:55=A0pm, Hans-Bernhard Br=F6ker <HBBroe...@t-online.de> wrote: > Am 01.07.2010 00:50, schrieb esmitt: > > > Hi everyone, some of you know how fill a...

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 Brian <cuckoo@cs.nchu.edu.tw> wrote: > Assume one point is within a cuboid, > The point should be represented by a linear combination of all vertices > of the coboid. Such a linear combination would be infinitely ambiguous, which means the term "barycentric coordinates" from your subject line wouldn't really apply here. Coordinates are supposed to be a one-to-one mapping. > subdivide the cuboid into several tetrahedra? Yes. At least four of them, to be precise. Even then, there's some ambiguity, because different subdivisions of the cuboid would yield different coordinates. A subdivision exploiting symmetries of the cuboid should be less ambiguous. E.g. you could divide the cuboid into 6 rectangular pyramids (one per face, with the centroid of the volume as their apex), and each of those into 4 triangular pyramids by adding the face center. -- Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de) Even if all the snow were burnt, ashes would remain. On 21 Jan 2005 10:11:45 GMT, Hans-Bernhard Broeker <...

Graphic algorithms are bogus
I think all the algorithms are crap, not useful at all.Old programs on the IBM PC were much faster on a 4.77 Mhz machine than the crap of today. I think we should use ASCII graphics again. And Carl Dau said... > I think all the algorithms are crap, not useful at all.Old programs on the > IBM PC were much faster on a 4.77 Mhz machine than the crap of today. > > I think we should use ASCII graphics again. http://www.jfedor.org/aaquake2/ http://www.catb.org/~esr/jargon/html/T/troll.html > I think all the algorithms are crap, not useful at all. That's why research is do...

how to do interpolation in polar coordinate
I have a polar data set (Theta, Rho, Z). it is not uniformly distributed, for example, Theta=[0.1,0.24,0.3...],Rho=[2,4,3...],Z=[1,2,0...]. I'd like to have another data set which has uniform Theta and Rho, say, Theta=[0.1,0.2,0.3...],Rh0=[0,1,2...]. I understand that meshgrid works only for Cartesian coordinates. Any suggestions for the polar system? Thanks a lot. ...

Using coordinate interpolator
Hi , Im trying to use the corordinate interpolator to generate a line whose length keeps changing. Below is the matlab code with vrml commands. Could anyone tell me why the length of the line is not changing filename='myshape2.wrl'; delete(filename); fid = fopen(filename, 'w'); fprintf(fid,'#VRML V2.0 utf8'); fprintf(fid,'\n Background { \n'); fprintf(fid,'\n groundAngle 1.5708 \n'); fprintf(fid,'\n groundColor [ 0 0 0, 0 0 1 ] \n'); fprintf(fid,'\n skyAngle [ 0.1, 1.2, 1.57 ] \n'); fprintf(fid,'\n skyColor [ 0.76238 0.8...

c++ graphic algorithm
Hi Would you introduce me a good c++ book about computer graphic with actual example, i am currently developing a GUI engine (like QT) for my operating system. A website would be appreciates thanks from Peter (cmk128@hotmail.com) cmk128@hotmail.com =E5=AF=AB=E9=81=93=EF=BC=9A > Hi > Would you introduce me a good c++ book about computer graphic with > actual example, i am currently developing a GUI engine (like QT) for my > operating system. > A website would be appreciates > thanks > from Peter (cmk128@hotmail.com) Hi I want a book that talk about image processing, like this: http://www.jhlabs.com/ip/filters/ thanks AGG http://www.antigrain.com/ ...

How to get Interpolated Coordinates
Hi, I have a 3D matrix where Z depends on X Y . I use this code to generate my surface : F = TriScatteredInterp(x,y,z); Z= F(X,Y); h=surf(X,Y,Z,'FaceColor','interp','FaceAlpha',0.8); Using the cursormode i can press anywhere on the surface and get the interpolated values for any given point that wasn't initially in my matrix. Is there a way to specify Z programmatically and get X & Y ? We know that all values of Z are unique so to each Z value corresponds only one combination of X & Y thanks in advance ...

Multidimensioanl barycentric interpolation
How do I compute a barycentric interpolation for multidimensional data? My dataset consists of 7 columns (6 coordinates, 1 value). I need to interpolate values for coordinates that are missing in the dataset. Thank you! Use griddatan with the default (linear) option.You should expect memory consumption to be large and this may limit the size of the dataset that can be handled on your computer. Memory consumption grows exponentially with increasing dimension, a problem more commonly known as the "curse of dimensionality" and with a 6D problem you are approaching the limits o...

Interpolation problem, optimization algorithms
hey all, I have a group of very noisy functions that I want to interpolate and simplify and they have two things in common: they are diophantine, positive, and are almost linear over certain ranges. For example, one function might be linear for the first 10 values of x, then have a different linear approximation over 11-50, then a different one over 51-100, etc. Hence, I'd like to simplify them into piecewise linear functions, ie: f[x_] := a1 * x + b1 /; x < 10; f[x_] := a2 * x + b2 /; 10 <= x < 50; f[x_] := a3 * x + b3 /; 50 <= x < 100; f[x_] :...

Interpolation does not quite interpolate
I'm having trouble with Interpolation[]. With InterpolationOrder->0, Interpolation[] returns a function that fails to "agree with data at every point" as promised in the manual. When InterpolationOrder->1 or higher, the problem disappears. Here is an example. Notice that although the point {1,1} is specified f[1] = 2. In[1]:= f = Interpolation[{{1, 1}, {2, 2}, {3, 3}}, InterpolationOrder -> 0] Out[1]= InterpolatingFunction[{{1, 3}}, <>] In[2]:= f[1] Out[2]= 2 (* f[1] should be 1 *) In[3]:= f[2] Out[3]= 2 In[4]:= f[3] Out[4]= 3 In[5]:...

2D/3D interpolation algorithm
Hi, I'm looking for a 2D or 3D interpolation algorithm. I have a set of points (x,y,z) with a grey value[0-255] assigned to each point. Now I want to construct a number of parallel slices based on these values. It would be great if anybody could point me to an open source searching/ interpolation algorithm (preferable C or C++) I could use to build the slices. Any help would be highly appropriate! Regards, Christopher -- Christopher Intemann mail:inte@goe.net .~. phone/fax:0700/I-N-T-E-M-A-N-N /v\ Iridium:+881631417758 // \\ ...

controlling interpolation when scaling graphics
I'm working on an experimental image manipulation application and don't have a lot of experience in this area. I'm trying to scale up (zoom in on) an image on the form *without* having VB automatically interpolate & soften it. What I'm looking for is the Photoshop equivelent of setting image interpolation to 'Nearest Neighbor' vs. 'Bicubic'. I've searched google groups and the MSDN library for an answer to this problem (Zoom, StretchBlt, etc), but can't turn up a thing - hope someone here can help. Thanks in advance. ...

interpolating spline algorithm for the ends
I'm developing a Fortran program (yes, Matlab is not the be all and end all, Fortran still has its place). It uses interpolating cubic splines. I've used the spline routine from Numerical Recipes, but it often gives unsatisfactory results between knot 1 and 2 and between knot n-1 and n. I guess this is because it assumes f''(1)=f''(n)=0 (as all other algorithms I've found so far do). On the other hand, the Matlab spline function handles the ends quite nicely. I've been trying to reverse-engineer the Matlab algorithm, without success so far. Does an...

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... - Asbj�rn Lord Crc wrote: > just curious if there's a neat way to get the barycentric coordinates > (or similar) of the current fragment in a GLSL shader? NO, but you can get the same result if you can afford to choose the primitive type to be GL_TRIANGLES and setup the barycentric to each vertex as: A = vec3(1.0, 0.0, 0.0); B = v...

Interpolation algorithms of image resizing
Hi, I need to do some comparison of those algorithms and Im wondering if there are some good books that I should read to know more about it. Can You recommend som titles? -- ________ Paweł Wołoszyn http://www.goldenline.pl/pawel-woloszyn2 > I need to do some comparison of those algorithms and Im wondering if > there are some good books that I should read to know more about it. Can > You recommend som titles? In Graphics Gems III: Schumacher, Dale A., General Filtered Image Rescaling. ...

controlling interpolation when scaling graphics
I'm working on an experimental image manipulation application and don't have a lot of experience in this area. I'm trying to scale up (zoom in on) an image on the form *without* having VB automatically interpolate & soften it. What I'm looking for is the Photoshop equivalent of setting image interpolation to 'Nearest Neighbor' vs. 'Bicubic'. I've searched google groups and the MSDN library for an answer to this problem (Zoom, StretchBlt, etc), but can't turn up a thing - hope someone here can help. Thanks in advance. -alu "alu" <no...

controlling interpolation when scaling graphics
I'm working on an experimental image manipulation application and don't have a lot of experience in this area. I'm trying to scale up (zoom in on) an image on the form *without* having VB automatically interpolate & soften it. What I'm looking for is the Photoshop equivalent of setting image interpolation to 'Nearest Neighbor' vs. 'Bicubic'. I've searched google groups and the MSDN library for an answer to this problem (Zoom, StretchBlt, etc), but can't turn up a thing - hope someone here can help. Thanks in advance. -alu ...

Get Graphics Coordinates accuracy
I came across a limitation in the mechanism for copying coordinates of points in 2D graphics (the Get Coordinates button in the Drawing Tools palette) in V6.03. Consider the following plot of a sine wave Plot[Sin[2 x], {x, 20270, 20275}] When I try to select and paste the coordinates of the two crests of the wave, I typically get two points with the same x-coordinate {{2.027*^4, 0.99}, {2.027*^4, 0.99}} whereas I would expect the two x-coordinates to be around 20270.3 and 20273.5, values which are well separated on the plot. This seems to happen because the Get Coordinate...

Web resources about - interpolation of barycentric coordinates - comp.graphics.algorithms

Interpolation - Wikipedia, the free encyclopedia
In the mathematical field of numerical analysis , interpolation is a method of constructing new data points within the range of a discrete set ...

Brief Interpolation on the Contrasting Company Cultures of Microsoft and Apple
Interesting to see Frank Shaw celebrating (or, if you prefer, gloating) about this deal on Twitter: Hey Google – we are the 70% #anotherandroidlicense ...

Price Drop: Interpolation 1.0
Interpolation 1.0 2 Device: iOS Universal Category: Education Price: Free, Version: 2 ( iTunes ) Description: This is an application which ...

Demize99 comments on We need someone to create a guide for the new Network Interpolation Setting slider ...
"Trust" is a strong word. BF3's hit model uses a combined client server model, a Hybrid Hit Detection. The client says to the server "Hey, I ...

Argo, Latitude, Day, and Reynolds Interpolation
Guest post by Willis Eschenbach This is another of my occasional reports from my peripatetic travels through the Argo data (see the Appendix ...

The easiest way to get 60fps frame interpolation playback using MPC-HC, MPC-BE
Convert 24 fps videos to 48/60 fps on-the-fly and watch movies and videos with the soap opera effect (motion interpolation). Support Media Player ...

Bilinear interpolation - Wikipedia, the free encyclopedia
Example of bilinear interpolation on the unit square with the z-values 0, 1, 1 and 0.5 as indicated. Interpolated values in between represented ...

Whittaker–Shannon interpolation formula - Wikipedia, the free encyclopedia
The Whittaker–Shannon interpolation formula or sinc interpolation is a method to construct a continuous-time bandlimited function from a sequence ...

Linear interpolation - Wikipedia, the free encyclopedia
which can be derived geometrically from the figure on the right. It is a special case of polynomial interpolation with n = 1. Solving this equation ...

Bicubic interpolation - Wikipedia, the free encyclopedia
In mathematics , bicubic interpolation is an extension of cubic interpolation for interpolating data points on a two dimensional regular grid ...

Resources last updated: 3/8/2016 2:52:53 AM