Re: vector analysis example question



Randy Poe wrote:

Here's a little useful geometry for you. Any vector of the
form a1*v1 + a2*v2 + a3*v3 with a1 + a2 + a3 = 1, and
a1, a2, a3 >= 0 is what is called a "convex combination"
of the vectors v1, v2, v3. It is guaranteed to lie in the interior
of the "convex hull" of those vectors (which means in this
case the triangle they form).

Thanks Randy. I really don't remember any of this, which
isn't surprising.


Computer graphics people call the a's the "barycentric
coordinates" of points inside the triangle, a very useful
concept. The barycentric coordinates of the midpoint of
the equilateral triangle is a1 = a2 = a3 = 1/3.

I didn't understand how they got the 1/3, but given
below, would that be the correct 'proof' of why
a1= a2 = a3 = 1/3?



Now, armed with the above...

I got (1/sqrt(3)) * (i + j +k)

And because a1 + a2 + a3 = 3/sqrt(3) = sqrt(3),
I know that this point is not in the plane formed by
i, j and k. It's in the plane formed by sqrt(3)*i,
sqrt(3)*j, sqrt(3)*k.

D'oh.


By the way, the idea of convex combinations can be
used to interpolate between pairs of vectors also.
Any point of the form t*v1 + (1-t)*v2 lies on the line
segment between v1 and v2 for 0 <= t <= 1. Choose
t = 0.5 and you have the midpoint.

So the midpoint of j, k is 0.5*(0, 1, 0) + 0.5*(0, 0, 1)
= (0, 0.5, 0.5). The line to (1,0,0) is in direction
(1,0,0) - (0,0.5,0.5) = (1, -0.5, -0.5)


Those are the opposite directions, but OK.

Finding the intersection point
proved a little difficult with my rusty math.

You have found two directions. But what does the
"intersection point" mean? Shouldn't the starting
point come into it?

Hm. Oh. Now I'm beginning to understand where
I buggered up. So basically I should have done something
of the following?

R(t) = R_0 + V't where R_0 = ( x_0, y_0, z_0)
and V' = vector parallel to the
vectors in question.

So, it would be R_0(t) = ( 1.0, 0.0, 0.0) + (-i + 0.5j + 0.5k)t?

Which creates a parametric equation set of :

x - 1= -t, y= (1/2)*t , z = (1/2)*t

Then the other one where R_1(t) = (0.0, 1.0, 0.0) + (+0.5i - j + 0.5k)t

->
x = (1/2)t y -1 = -t z = (1/2)t

Then to solve for x,y and z, using:

x - 1 = -t, x = (1/2)t, y = (1/2)*t, z= (1/2)*t

--> (1/2)t - 1 = -t => t = 2/3

so x = (1/2)* (2/3) = 1/3
and similarly , y = 1/3, z = 1/3

And then so the center is at (1/3, 1/3, 1/3) or
(1/3)*(i + j + k).

Wow. Is it this?


I got confused. I thought when the book referred
to V as parallel to (R - R_0), I thought it was
referring to the vector (i - k) or (j - k).

But in actual fact, the vector v was referring
to the vector (in my current case) < -1, 0.5, 0.5>.

Thanks for the very fast help. I very much
appreciate it.


Ed
.



Relevant Pages

  • 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: Barycentric to cartesian?
    ... the plane and then determine if it is in the triangle. ... but it leaves me with barycentric coordinates. ... the Moller-Trumbore ray-triangle intersection algorithm. ... My apologies, you are right, I was looking at the Moller-Trumbore algorithm ...
    (comp.graphics.algorithms)
  • Re: Barycentric to cartesian?
    ... 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. ... the Moller-Trumbore ray-triangle intersection algorithm. ...
    (comp.graphics.algorithms)
  • Re: vector analysis example question
    ... Having not touched a single math book for ten years, ... the 'midpoint of the circle'. ... case the triangle they form). ... The three points of intersection can be joined by ...
    (sci.math)
  • Re: Find point given 2 points
    ... >The midpoint of the line can be calculated as using the ... >A right triangle is formed at the midpoint. ... of the perpendicular vector ... Make a unit vector out of this by ...
    (sci.math)