Re: [Algorithms] decompose onto non-orthogonal vectors
Brought to you by:
vexxed72
|
From: Pierre T. <p.t...@wa...> - 2000-07-15 12:28:36
|
b
/
v/----p
/ /
/ /
/ /
c ---------a
u
- Add a point c to form a triangle abc.
- Now you can use the standard raytracing code which computes (u,v) =
ray-triangle impact (texture) coordinates, then check if 0<u<1, 0<v<1 and
0<u+v<1 to keep or discard the impact.
The underlying method is the same as the one already suggested (expressing p
in the abc basis). But in the raytracing field you'll find less formal and
more pragmatic/optimized-to-death answers/code.
/*
Pierre Terdiman * Home: p.t...@wa...
Software engineer * Zappy's Lair: www.codercorner.com
*/
----- Original Message -----
From: Discoe, Ben <ben...@in...>
To: <gda...@li...>
Sent: Saturday, July 15, 2000 4:08 AM
Subject: [Algorithms] decompose onto non-orthogonal vectors
>
> I thought it would be a simple problem, but all usual sources failed to
> answer, so perhaps it will be obvious to someone on this list.
>
> Given a point p and two unit vectors a and b like this:
>
>
> how to you get scalars (u,v) such that u*a + v*b = p?
> Ie. decompose p onto a and b.
>
> I promise i consulted an academic, a linear algebra textbook and the WWW
> (all failed) before resorting the list :)
>
> Thanks,
> Ben
> http://vterrain.org/
>
>
> _______________________________________________
> GDAlgorithms-list mailing list
> GDA...@li...
> http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list
|