gdalgorithms-list Mailing List for Game Dev Algorithms (Page 1439)
Brought to you by:
vexxed72
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(390) |
Aug
(767) |
Sep
(940) |
Oct
(964) |
Nov
(819) |
Dec
(762) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(680) |
Feb
(1075) |
Mar
(954) |
Apr
(595) |
May
(725) |
Jun
(868) |
Jul
(678) |
Aug
(785) |
Sep
(410) |
Oct
(395) |
Nov
(374) |
Dec
(419) |
2002 |
Jan
(699) |
Feb
(501) |
Mar
(311) |
Apr
(334) |
May
(501) |
Jun
(507) |
Jul
(441) |
Aug
(395) |
Sep
(540) |
Oct
(416) |
Nov
(369) |
Dec
(373) |
2003 |
Jan
(514) |
Feb
(488) |
Mar
(396) |
Apr
(624) |
May
(590) |
Jun
(562) |
Jul
(546) |
Aug
(463) |
Sep
(389) |
Oct
(399) |
Nov
(333) |
Dec
(449) |
2004 |
Jan
(317) |
Feb
(395) |
Mar
(136) |
Apr
(338) |
May
(488) |
Jun
(306) |
Jul
(266) |
Aug
(424) |
Sep
(502) |
Oct
(170) |
Nov
(170) |
Dec
(134) |
2005 |
Jan
(249) |
Feb
(109) |
Mar
(119) |
Apr
(282) |
May
(82) |
Jun
(113) |
Jul
(56) |
Aug
(160) |
Sep
(89) |
Oct
(98) |
Nov
(237) |
Dec
(297) |
2006 |
Jan
(151) |
Feb
(250) |
Mar
(222) |
Apr
(147) |
May
(266) |
Jun
(313) |
Jul
(367) |
Aug
(135) |
Sep
(108) |
Oct
(110) |
Nov
(220) |
Dec
(47) |
2007 |
Jan
(133) |
Feb
(144) |
Mar
(247) |
Apr
(191) |
May
(191) |
Jun
(171) |
Jul
(160) |
Aug
(51) |
Sep
(125) |
Oct
(115) |
Nov
(78) |
Dec
(67) |
2008 |
Jan
(165) |
Feb
(37) |
Mar
(130) |
Apr
(111) |
May
(91) |
Jun
(142) |
Jul
(54) |
Aug
(104) |
Sep
(89) |
Oct
(87) |
Nov
(44) |
Dec
(54) |
2009 |
Jan
(283) |
Feb
(113) |
Mar
(154) |
Apr
(395) |
May
(62) |
Jun
(48) |
Jul
(52) |
Aug
(54) |
Sep
(131) |
Oct
(29) |
Nov
(32) |
Dec
(37) |
2010 |
Jan
(34) |
Feb
(36) |
Mar
(40) |
Apr
(23) |
May
(38) |
Jun
(34) |
Jul
(36) |
Aug
(27) |
Sep
(9) |
Oct
(18) |
Nov
(25) |
Dec
|
2011 |
Jan
(1) |
Feb
(14) |
Mar
(1) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(37) |
Sep
(6) |
Oct
(2) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
(7) |
Mar
|
Apr
(4) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(10) |
2013 |
Jan
|
Feb
(1) |
Mar
(7) |
Apr
(2) |
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(14) |
Feb
|
Mar
(2) |
Apr
|
May
(10) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(12) |
Nov
|
Dec
(1) |
2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
From: Matt A. <de...@gm...> - 2000-07-15 11:18:45
|
I need this for aesthetic reasons :) I've got an abstract CThread class. If a want to create a new thread, I build my process class and inherit CThread, which creates a new thread by construction. Now I want my main-threadloop-class to inherit CThread, too, to provide all the thread functionality to my main thread. But that thread already exists created by compiler ), and shouldn't be created again by CThread. Of course I can put CThread () and ~CThread () in functions like Create() and Destroy() and leave the constructor / destructor empty. But it'd be nicer if it could be done in another way... ----- Original Message ----- From: Favnir To: gda...@li... Sent: Saturday, July 15, 2000 1:32 PM Subject: Re: [Algorithms] C++ inherited constructors The only way you can do this is to define a (preferably) protected do-nothing constructor for the base class, and inherit it in the subclass constructor. But, why in the world would you need to do this, in the first place? Are, F ----- Original Message ----- From: Matt Adams To: gda...@li... Sent: Saturday, July 15, 2000 12:22 PM Subject: [Algorithms] C++ inherited constructors Hi, I got a question about the C++ class hierarchy. class a { a () {...}; // constr a }; class b : a { b () {...}; // constr b }; b instance; When creating an instance of b, constructors for both class a and class b are called. Is there a way to suppress the automatic calling of constructor a ? Or something like 'overloading' the old constructor by a new one ? I couldn't find anything like that in the compiler docs. Any help appreciated, Matt _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: Gabor F. <xl...@po...> - 2000-07-15 11:06:16
|
i don't know if you can supress it, but why do you want to do it? object "a" must be constructed before the construction of "b" begins , and the only way to construct-initialize "a" is thru an "a"-constructor. if you have access to the sources of "a" you can create an empty constructor for "a".... but once again... why? Gabor Gabor Farkas - student / Comenius University ,Slovak Republic ---- If my mad scientist/wizard tells me he has almost perfected my Superweapon but it still needs more testing, I will wait for him to complete the tests. No one ever conquered the world using a beta version. (www.eviloverlord.com) ---- ----- Original Message ----- From: "Matt Adams" <de...@gm...> To: <gda...@li...> Sent: Saturday, July 15, 2000 12:22 PM Subject: [Algorithms] C++ inherited constructors > Hi, > > I got a question about the C++ class hierarchy. > > class a > { > a () {...}; // constr a > }; > > class b : a > { > b () {...}; // constr b > }; > > b instance; > > When creating an instance of b, constructors for both class a and class b > are called. > Is there a way to suppress the automatic calling of constructor a ? > Or something like 'overloading' the old constructor by a new one ? > I couldn't find anything like that in the compiler docs. > > Any help appreciated, > Matt > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Michael H. <he...@po...> - 2000-07-15 10:54:17
|
Make class A's default constructor do nothing, and make a second one that takes a useless argument. You can do it like this: class A { protected: A() {} // B can call this, but users will get warnings if they use it public: A(bool x); }; class B: public A { public: B(); // calls A(), which does nothing }; mike ----- Original Message ----- From: "Matt Adams" <de...@gm...> To: <gda...@li...> Sent: Saturday, July 15, 2000 3:22 AM Subject: [Algorithms] C++ inherited constructors > Hi, > > I got a question about the C++ class hierarchy. > > class a > { > a () {...}; // constr a > }; > > class b : a > { > b () {...}; // constr b > }; > > b instance; > > When creating an instance of b, constructors for both class a and class b > are called. > Is there a way to suppress the automatic calling of constructor a ? > Or something like 'overloading' the old constructor by a new one ? > I couldn't find anything like that in the compiler docs. > > Any help appreciated, > Matt > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > > |
From: Favnir <fa...@wi...> - 2000-07-15 10:33:28
|
The only way you can do this is to define a (preferably) protected do-nothing constructor for the base class, and inherit it in the = subclass constructor. But, why in the world would you need to do this, in the first place? Are, F ----- Original Message -----=20 From: Matt Adams=20 To: gda...@li...=20 Sent: Saturday, July 15, 2000 12:22 PM Subject: [Algorithms] C++ inherited constructors Hi, I got a question about the C++ class hierarchy. class a { a () {...}; // constr a }; class b : a { b () {...}; // constr b }; b instance; When creating an instance of b, constructors for both class a and = class b are called. Is there a way to suppress the automatic calling of constructor a ? Or something like 'overloading' the old constructor by a new one ? I couldn't find anything like that in the compiler docs. Any help appreciated, Matt _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: Matt A. <de...@gm...> - 2000-07-15 10:22:32
|
Hi, I got a question about the C++ class hierarchy. class a { a () {...}; // constr a }; class b : a { b () {...}; // constr b }; b instance; When creating an instance of b, constructors for both class a and class b are called. Is there a way to suppress the automatic calling of constructor a ? Or something like 'overloading' the old constructor by a new one ? I couldn't find anything like that in the compiler docs. Any help appreciated, Matt |
From: Jonathan B. <jo...@bo...> - 2000-07-15 07:50:20
|
In advance I'll say that this diatribe is not directed straight at Ben; it's to everyone on this list who isn't eager to learn math. Ben Discoe wrote: > I was asking if somebody knew the solution, not for how to do the math, > which i'm willing to leave to people who enjoy re-deriving solutions to math > problems. The problem here is that modern graphics programming is *all about* math. If you don't know the math, you can't play ball. You shouldn't think of the question you asked as some isolated problem that you ought to be able to look up in a book. If this were the best way to learn how to do things, then you'd need to look up hundreds of little special-case problems in order to write a modern 3D program that does interesting things. And as you've seen, it's often hard to find a lucid explanation of even one of these problems, even though lots of people know how to do them. To understand graphics publications and implement them, and especially to do new work, you need to be fluent enough in certain areas of math (linear algebra being a major one) that you just instinctively know answers to problems like the one you posed. Once you have this knowledge, you'll find that you look at problems in a different way. You'll skip over whole truckloads of questions that would have been really perplexing before, because now they're non-issues. Months of programming work that would have been misguided can now be eliminated. The scope of things you can do will be vastly expanded. Trying to do 3D graphics without linear algebra is like this: You want to be a sculptor and create this cool statue called The Thinker, and you've got the big block of stone, your hammer and chisel are sitting there on the table... but unfortunately you cut your hands off last month, so you're squeezing the chisel between two wrist-stumps and holding the hammer in your mouth and trying to bang away. It's not good for your dental work. -J. |
From: Scott J. S. <sjs...@um...> - 2000-07-15 07:15:38
|
Okay, let me try and explain this as simply as possible. You want to find scalars u,v such that u*a + v*b = p. Since these are 3-dimensional vectors, you have 3 equations and 2 unknowns: u*a1 + v*b1 = p1 u*a2 + v*b2 = p2 u*a3 + v*b3 = p3 where p1,p2,p3 are the coordinates of the point p, likewise for a1,a2,a3 and a, and b1,b2,b3 and b. How do you solve a system of 3 linear equations with 2 unknowns? If you don't know Gaussian elimination, this can be done with some simple algebraic rules and substituion. If you know your constant values (a, b, p) now, it's very simple to just do the necessary substitutions by hand. On the other hand, if the values are determined at run-time, coding the algebra isn't as easy, unless you use gaussian elimination, since gaussian elimination is essentially an algorithm for solving linear equations. The problem with "coding" algebra is that there are a lot of special cases. So I'll present you with one sample, "stupid" solution that will work, assuming that a1 is non-zero. Simply vary the approach if a1 is zero, and choose the starting equation using any element of a that is non-zero (at least one of them must be non zero, or else you reduce to a much simpler equation, since the point is along b). This is a dumb approach, and simply meant for a sample illustration of a possible, yet ugly way, to solve a system like this. It also assumes a solution exists: Start with equation 1. Solve for u in terms of v. This gives: u = (p1 - v*b1)/a1 plug this value of u into equation 2. This gives you: a2* (p1 -v*b1)/a1 + v*b2 = p2 now factor out v: v[ a2* (p1-v*b1)/a1 + b2 ] = p2 divide p2 by that big thing in brackets, so you have v by itself. Now you have v expressed entirely in terms of known values, so you know the value of v. with this, it is trivial to find the value of u, just plug back into the first equation. By plugging the vales of u and v you have determined into the third equation, you can see if in fact there is a real solution. If you end up getting something like 0=1 for the third equation upon substiting your discovered values of u and v, no solution exists. Note to Ron: obviously, this isn't rigorous at all, but the goal was merely give an impression of how the solution can be obtained. You'd really want to use gaussian elimination for anything like this, since all of the special cases (is a1 0? start with a different equation, is a1,a2,a3 all 0? just reduce to one equation, etc.) are neatly handled by it. In fact, I like to think of gaussian elimination as a mathematical "encapsulation" for solving systems of linear equations, it automatically takes care of the details for you. Try doing a search on the net for guassian elimination, you will definitely come across some hits. I believe I learned it my sophomore year of high school, algebra II class, so it's certainly not anything remotely unusual. Hope this helps. -- Scott Shumaker sjs...@um... On Fri, 14 Jul 2000, Discoe, Ben wrote: > > 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: > > b > / > v/----p > / / > / / > / / > ---------a > u > > 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 > |
From: Jim O. <j.o...@in...> - 2000-07-15 06:05:12
|
> > I prefer this answer to mine from a theory standpoint, because it > > expresses all of the gotchas that I had to list explicitly... code wise, I > > wouldn't want to actually make a matrix to solve it (i'm sure you wouldn't > > either). > > There was once a time when I would have thought this. But once you get > ... > this kind of code in a bug-free manner. I totally agree. I used to have all sorts of math functions, grabbed from this tutorial here and that book there and the end result was that I didn't even understand what was going on inside my own mathematics library - which makes it *really* hard to find a bug. Nowadays, I write down which matrices and matrix multiplications I need to get the job done and then implement it using 'dumb' matrix multiplications. Once I am sure it works, I feed the matrices and multiplications to this little tool I have written, which filters out any unnecessary steps in the multiplications (i.e. B.x.x = A.x.x * I.x.x + A.x.y * I.x.y would simply become B.x.x = A.x.x as I.x.x = 1 and I.x.y = 0, where I is identity and A and B are any given matrix). Works like a charm :-) Jim Offerman Innovade - designing the designer |
From: Discoe, B. <ben...@in...> - 2000-07-15 06:04:16
|
> From: ro...@do... [mailto:ro...@do...] > > Chapter 1 in any linear algebra book. I assure i looked in chapters 1 though 18 of my book ("calculus and analytic geomtry", thomas/finney) and nothing resemling a formula for decomposing a vector is anywhere in it. In general, math textbooks tend to be concerned with axioms and definitions, not with formulas that actually prove to be useful. > That is A SYSTEM OF TWO LINEAR EQUATIONS IN TWO UNKNOWNS u, v, > which you ought to have learned to solve in intermediate algebra, I was asking if somebody knew the solution, not for how to do the math, which i'm willing to leave to people who enjoy re-deriving solutions to math problems. > u = (p1 b2 - p2 b1)/(a1 b2 - a2 b1) > v = (a1 p2 - a2 p1)/(a1 b2 - a2 b1) OK, i'll believe that after solving for v and substituting twice (a page or so of algebra) you get that 2d solution. > If the denominator (a1 b2 - a2 b1) is zero then it means that a and b > are linearly dependent (i.e. collinear) and either it has no solution > (if p is not also collinear with a and b) or infinitely many different > solutions (if p is collinear with a and b) The picture i drew showed a nondegenerate case. > Now suppose that you are given this as a 3D problem, say > a = (a1, a2, a3) and b = (b1, b2, b3) Yes. I'm sorry i forgot to state that i do have 3d vectors, and p is known to lie in the plane formed by a and b. > It may or may not have solutions.. > Cramer's rule does not apply here, but Gaussian elimination > still does. Is this your way of saying you don't know the answer? It would be pretty sad if not a single person on the list knows the answer. I was kinda hoping *you* would, Ron :) > No, I will not belabor the list with a review of Gaussian elimination > algorithms. You will find one in Chapter 1 of your favorite linear > algebra book. The index in my textbook does not list "Gaussian elimination". Thanks, Ben http://vterrain.org/ |
From: Jonathan B. <jo...@bo...> - 2000-07-15 03:39:51
|
Will Portnoy wrote: > I prefer this answer to mine from a theory standpoint, because it > expresses all of the gotchas that I had to list explicitly... code wise, I > wouldn't want to actually make a matrix to solve it (i'm sure you wouldn't > either). There was once a time when I would have thought this. But once you get good at understanding transformations, it is *hugely* easier to just say something like: "Hey, I'll make some matrix, invert it, and transform something else by that to get my answer." (I don't mean for this problem, which requires no inversion, but.) It is a lot nicer to be able to come back to code like this later and understand what it's doing, as opposed to some random math that's going on. And it is also a lot easier to write this kind of code in a bug-free manner. Unless you really *really* care about speed, I'd recommend using a transformation-style approach if there is one. And if you do care about speed, I'd still recommend using this kind of approach, until you are sure the code works; *then* you optimize and keep the old code in a comment as a backup. > One thing I didn't mention, and I haven't proven it to myself > mathematically yet: if vectors a and b are linearly independent (which > they don't seem to be from the original thread author's drawing), then > there's only one solution for u and v. For example, in the "normal" > orthonormal basis that we use ((1,0,0)(0,1,0)(0,0,1), there's only one > linear combination of the basis that will give a point p. They are linearly independent in the drawing. Linearly independent does not mean orthogonal, it just means that the two vectors are not fully redundant (i.e. one is not a scalar multiple of the other). However it is a basic theorem of linear algebra that there is only one solution for p regardless of the vectors so long as they are linearly independent. -J. |
From: <ro...@do...> - 2000-07-15 03:28:25
|
Will Portnoy wrote: >> how to you get scalars (u,v) such that u*a + v*b = p? >> Ie. decompose p onto a and b. > >Regardless of what the answer is, you have one equation (ua + vb = p) and >two unknowns (u and v). Nah, it's one vector equation, so two scalar equations. >You need to come up with an equation involving u >and/or v that is linearly independent of the first equation, and then you >can solve the system of linear equations. > >You could make up something like: > >u + v = 1, which is the same as v = 1 - u > >and then substitute in to the first equation: > This part and the remainder is utter nonsense. |
From: <ro...@do...> - 2000-07-15 03:27:22
|
Jonathan Blow wrote: >"Discoe, Ben" wrote: >> >> 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. >> ... >This is one of those "fundamental linear algebra things" >that Ron and I were just talking about. > >Your original coordinates of 'p' are in the coordinate >system that we are used to, that is, two basis vectors >that are orthonormal. We will call this space R. > Actually you don't need them expressed in an orthonormal basis, any basis will do. (Although the solution is shorter when you have an orthonormal basis and have learned the concept of "dot product", but you might not get that until one of the later chapters. >You want the coordinates of 'p' in a system in which >the vectors are unit, but not orthogonal. We will call >this space S. > >Just build a transformation matrix from R to S, and >call that matrix T. Then p' = Tp and you are done. > >For instructions on how to make a matrix that goes from >one space to another, given the basis vectors of each >space, consult any one of a trillion graphics books. Again, you don't need matrices (maybe chapter 3) but just high school algebra. |
From: <ro...@do...> - 2000-07-15 03:24:24
|
Discoe, Ben wrote: > >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: > > b > / > v/----p > / / > / / > / / >---------a > u > >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 :) > Sheesh, this is a problem that you ought to be able to solve after doing Chapter 1 in any linear algebra book. In fact, under the most natural interpretation of what you have stated, this is a problem in intermediate (high school) algebra. First, this is essentially a 2D problem because it has no solution unless p lies in the plane spanned by a and b. So I suppose that it is posed as a 2D problem, then consider what to do if you are dealing with it posed as a 3 or higher dimensional problem So if you are "given" a, b and p, then you must be given their components with respect to SOME coordinate system (and it doesn't even have to be an orthonormal coordinate system), So we suppose you are given a = (a1, a2), b=(b1, b2) and p = (p1, p2), where a1, a2, b1, b2, p1, p2 are known scalars. (If you are not given this info, but just a diagram, then we are reduced to a high school geometry compass and straight edge solution, which also is fun, but I'll forbear) Now when you write out your vector equation ua + vb = p in components it is actually a system of two linear equations u a1 + v b1 = p1 u a2 + v b2 = p2 (Note that I refuse to use * for multiplication in algebra, even in ASCII algebra) That is A SYSTEM OF TWO LINEAR EQUATIONS IN TWO UNKNOWNS u, v, which you ought to have learned to solve in intermediate algebra, probably the simplest of all problems in the subject that we call "linear algebra", no? Gaussian elimination, the general means of attacking all linear systems, works fine for this, but most people would have remembered the Cramer's rule solution in terms of determinants. u = (p1 b2 - p2 b1)/(a1 b2 - a2 b1) v = (a1 p2 - a2 p1)/(a1 b2 - a2 b1) Voilà la solution| (Where I use the French in honor of July 14). If the denominator (a1 b2 - a2 b1) is zero then it means that a and b are linearly dependent (i.e. collinear) and either it has no solution (if p is not also collinear with a and b) or infinitely many different solutions (if p is collinear with a and b) Sheesh. What kind of "academic" did you consult, a cooking teacher? Now suppose that you are given this as a 3D problem, say a = (a1, a2, a3) and b = (b1, b2, b3) Then you have u a1 + v b1 = p1 u a2 + v b2 = p2 u a3 + v b3 = p3 a system of THREE linear equations in TWO unknowns. It may or may not have solutions, in fact, as stated above, it will have a solution only if p lies in the plane spanned by a and b, which requires that the three equations be linearly dependent. Cramer's rule does not apply here, but Gaussian elimination still does. As you apply your favorite Gaussian elimination algorithm, one of two things will happen: either (1) you will get one of the equations into the form 0 = 0 , in which case it is irrelevant and you are left with a system of two equations in two unknowns, or (2) you will get one of the equations into the form 0 = 1, in which case there is no solution, i.e. p does NOT lie in the plane spanned by a and b No, I will not belabor the list with a review of Gaussian elimination algorithms. You will find one in Chapter 1 of your favorite linear algebra book. Sheesh. You weren't trolling me were you? |
From: Discoe, B. <ben...@in...> - 2000-07-15 03:15:50
|
Hi Jonathan! > This is one of those "fundamental linear algebra things" > that Ron and I were just talking about. Yeah. I wonder why it's still so hard to find and express an answer.. > Just build a transformation matrix from R to S Could you give me a hint how this is done? > For instructions on how to make a matrix that goes from > one space to another, given the basis vectors of each > space, consult any one of a trillion graphics books. The answer apparently isn't in the books i have.. > > I promise i consulted an academic > > What kind of academic was that? A guy from the Stanford graphics lab, just left the phd program to work on distributed rendering architectures.. he started on about barycentric coordinates but couldn't give an actual answer. Thanks, Ben |
From: Will P. <wi...@cs...> - 2000-07-15 03:08:11
|
I prefer this answer to mine from a theory standpoint, because it expresses all of the gotchas that I had to list explicitly... code wise, I wouldn't want to actually make a matrix to solve it (i'm sure you wouldn't either). One thing I didn't mention, and I haven't proven it to myself mathematically yet: if vectors a and b are linearly independent (which they don't seem to be from the original thread author's drawing), then there's only one solution for u and v. For example, in the "normal" orthonormal basis that we use ((1,0,0)(0,1,0)(0,0,1), there's only one linear combination of the basis that will give a point p. i'm assuming the basis vectors span the subspace for those mathematically inclined people who want to jump on me. :) Will ---- Will Portnoy http://www.cs.washington.edu/homes/will On Fri, 14 Jul 2000, Jonathan Blow wrote: > "Discoe, Ben" wrote: > > > > 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: > > > > b > > / > > v/----p > > / / > > / / > > / / > > ---------a > > u > > > > how to you get scalars (u,v) such that u*a + v*b = p? > > Ie. decompose p onto a and b. > > This is one of those "fundamental linear algebra things" > that Ron and I were just talking about. > > Your original coordinates of 'p' are in the coordinate > system that we are used to, that is, two basis vectors > that are orthonormal. We will call this space R. > > You want the coordinates of 'p' in a system in which > the vectors are unit, but not orthogonal. We will call > this space S. > > Just build a transformation matrix from R to S, and > call that matrix T. Then p' = Tp and you are done. > > For instructions on how to make a matrix that goes from > one space to another, given the basis vectors of each > space, consult any one of a trillion graphics books. > > -J. > > > > I promise i consulted an academic > > What kind of academic was that? > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Daniel R. <dan...@ho...> - 2000-07-15 02:43:20
|
> >Shorter is better for me... [GDA] would be sweet. > mee, too because long subject get always lost: RE: [GDAlgorithms-List] Re: Meshpr... ________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com |
From: Will P. <wi...@cs...> - 2000-07-15 02:41:27
|
> how to you get scalars (u,v) such that u*a + v*b = p? > Ie. decompose p onto a and b. Regardless of what the answer is, you have one equation (ua + vb = p) and two unknowns (u and v). You need to come up with an equation involving u and/or v that is linearly independent of the first equation, and then you can solve the system of linear equations. You could make up something like: u + v = 1, which is the same as v = 1 - u and then substitute in to the first equation: ua + vb = p ua + (1 - u) b = p ua - ub = p - b u = (p - b) / (a - b) and then v = 1 - u... assuming I didn't make any mistakes in this textual algebra, which is hard for me to write (and I imagine hard to read). the thing is, this made-up equation (u + v = 1) doesn't guarrantee a positive u and positive v. so I hope you weren't looking for that. :) the other problem is you have to make sure vector a and vector b are linearly independent, or there is likely to be no solution, no matter what u, v, and the second equation is. Will |
From: Jonathan B. <jo...@bo...> - 2000-07-15 02:34:19
|
"Discoe, Ben" wrote: > > 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: > > b > / > v/----p > / / > / / > / / > ---------a > u > > how to you get scalars (u,v) such that u*a + v*b = p? > Ie. decompose p onto a and b. This is one of those "fundamental linear algebra things" that Ron and I were just talking about. Your original coordinates of 'p' are in the coordinate system that we are used to, that is, two basis vectors that are orthonormal. We will call this space R. You want the coordinates of 'p' in a system in which the vectors are unit, but not orthogonal. We will call this space S. Just build a transformation matrix from R to S, and call that matrix T. Then p' = Tp and you are done. For instructions on how to make a matrix that goes from one space to another, given the basis vectors of each space, consult any one of a trillion graphics books. -J. > I promise i consulted an academic What kind of academic was that? |
From: Ignacio C. <i6...@ho...> - 2000-07-15 02:20:57
|
Discoe, Ben wrote: > Given a point p and two unit vectors a and b like this: > > b > / > v/----p > / / > / / > / / > ---------a > u > > how to you get scalars (u,v) such that u*a + v*b = p? > Ie. decompose p onto a and b. what you are trying to do is usually called 'change of basis' look here for further explanations: http://www.math.hmc.edu/calculus/tutorials/changebasis/ Ignacio Castano ca...@cr... |
From: Rob K. <rk...@bu...> - 2000-07-15 02:19:50
|
Shorter is better for me... [GDA] would be sweet. Rob |
From: Akbar A. <sye...@ea...> - 2000-07-15 02:14:13
|
this might be overdoing this and i don't want to start ... <snip> :D peace. akbar A. -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Tom Hubina Sent: Friday, July 14, 2000 6:33 PM To: gda...@li... Subject: Re: [Algorithms] Message format At 08:01 PM 7/14/2000 -0500, you wrote: >i second that if it's okay with tom. How's this? Tom _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |
From: Discoe, B. <ben...@in...> - 2000-07-15 02:08:53
|
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: b / v/----p / / / / / / ---------a u 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/ |
From: gl <gl...@nt...> - 2000-07-15 01:28:25
|
perfect ;) -- gl ----- Original Message ----- From: "Tom Hubina" <to...@3d...> To: <gda...@li...> Sent: Saturday, July 15, 2000 2:33 AM Subject: Re: [Algorithms] Message format > At 08:01 PM 7/14/2000 -0500, you wrote: > >i second that if it's okay with tom. > > How's this? > > Tom > > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |
From: Tom H. <to...@3d...> - 2000-07-15 01:18:59
|
At 08:01 PM 7/14/2000 -0500, you wrote: >i second that if it's okay with tom. How's this? Tom |
From: Akbar A. <sye...@ea...> - 2000-07-15 01:03:46
|
i second that if it's okay with tom. peace. akbar A. "We want technology for the sake of the story, not for its own sake. When you look back, say 10 years from now, current technology will seem quaint" Pixars' Edwin Catmull. -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of gl Sent: Friday, July 14, 2000 7:46 PM To: gda...@li... Subject: Re: [GDAlgorithms-List] Re: [Algorithms] Message format I'm doing this publically Tom to get a consensus (or otherwise). Can we change the subject list title to be shorter? Right now it eats too much subject real-estate. I suggest simply [GDAlgos-List], and if poss. drop the GD too. It might not seem like much, but it matters to me (opinions?). -- gl ----- Original Message ----- From: "Tom Hubina" <to...@3d...> To: "Algorithms List" <alg...@3d...> Sent: Friday, July 14, 2000 11:22 PM Subject: [GDAlgorithms-List] Re: [Algorithms] Message format > At 09:43 AM 7/14/2000 -0700, you wrote: > >There has been some kind of breakdown of message formatting since moving the > >list to the new host. > > > >I read the list on two different mail readers from two diffferent sites. > >One is Outlook Express the other Forte Agent. Since the changeover of the > >list host, the messages have been all but unreadable on Outlook Express, and > >they were perfectly OK before. The header information, author, subject etc. > >are all blank where they used to appear, but the entire header information , > >including all which used to be hidden, > > is in the body of the message. > > > >Also I get lots of "=20"s at the end of lines and whole lines of "=20"s at > >the end of > > > >This makes the whole list practically unusable from the site where I use > >Outlook Express. > > > >Interestingly, there is no change in the way the messages are presented in > >Forte Agent. > > From what I can tell, the temp server that was in place had garbled > headers. The SourceForge stuff seems to be working correctly. If anyone has > a problem with a message with the new list name in the title, please let me > know at to...@3d... > > Tom > > > > > _______________________________________________ > GDAlgorithms-list mailing list > GDA...@li... > http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list |