Dont you just divide the elements of the vector?
vector ( v1.x / v2.x, v1.y / v2.y, v1.z / v2.z );
that's about what the /-overloader of my vector class looks like anyway =)
--stockholm.postproduction | www.stopost.se
On 2/6/06, Mathieu Leclaire <mleclair(at)hybride.com> wrote:>>>> We are talking about vectors hereâ if you say f(x,y,t) = (x-y)*t+y = p ->> t = (y-p)/(y-x) but if x, y and p are vectors, how do you divide 2> vectors? I don't knowâ maybe I'm missing something obvious but if I go the> long way, here's what happens:>>>>>> -----Original Message-----> From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of> Halfdan Ingvarsson> Sent: Monday, February 06, 2006 2:55 PM> To: XSI(at)Softimage.COM> Subject: RE: Math question>>>>> Yay. Linear algebra. Start off by making yourself a large cup of coffee. And> then another one.>>>> Now then, the basic function you're dealing with is f(x,y,t) = (x-y)*t+y> = p and its solution in 't' is t = (y-p)/(y-x)>>>> Using that, let's restate your code as an equation using that function, like> so:>>>> f( f( T2.pt2,T1.pt2,dy), f( f(T2.pt1, T2.pt0, dx), f(T1.pt1, T1.pt0, dx),> dy), dz ) = P>>>> Now all you've got left !
to do is to expand the terms and start solving. It's> probably best to start with dx, followed by dy and dz.>>>> The good thing here is that the x,y and z components of the vectors are all> independent and you don't have to think about them when solving the> equation(s).>>>> The rest I leave as an exercise to you. Good luck!>>>> - ï>>> -----Original Message-----> From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of> Mathieu Leclaire> Sent: Monday, 06 February, 2006 13:54> To: XSI(at)Softimage.COM> Subject: Math question>> Hey guys, I have a question for the Math experts out there.>>>> I place a point p in space depending on the 3 points of 2 triangles and 3> coordinates dx, dy, dz. Let's say I have T1 and T2, the 2 triangles and each> triangle has 3 pts: T1.pt0 would be the first point in T1â I calculate p> using the following procedure:>>>> iT1.Sub(T1.pt1, T1.pt0).ScaleInPlace(dx).AddInPlace(T1.pt0);>> iT2.Sub(T2.pt1, T2.pt0).ScaleInPlace(dx).Ad!
dInPlace(T2.pt0);>>>> o1.Sub(iT2, iT1).ScaleInPlace(dy).AddInP!
lace(iT1
);>> o2.Sub(T2.pt2, T1.pt2).ScaleInPlace(dy).AddInPlace(T1.pt2);>>>> p.Sub(o2, o1).ScaleInPlace(dz).AddInPlace(o1);>>>>>> âso iT1 and iT2 are the points at dx% between the pt0 and pt1 of T1 and T2.> o1 and o2 are the points at dy% between iT1 and iT2 and between the pt2 of> T1 and T2. And finally, p is the point at dz% between o1 and o2.>>>> So my question is the following: What if I already know p, T1 and T2 and I> want to calculate dx, dy and dzâ how should I do that?>>>>>> Mathieu Leclaire>> R&D Programmer>> Hybride
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi