transform riddle 2004-01-30 - By Neto
Back Just adding...
When you spply another transform to a vector that had a transform applied to it, the new transform will override the old one. It's bizarre, but that how it works.
For performance's sake, I keep a global called "gZeroVector" to use when doing transform with vectors (creating a vector everytime can be expensive).
-- -- Original Message -- -- From: "James Newton" <james.newton@(protected)> To: <dir3d-l@(protected)> Sent: Friday, January 30, 2004 2:26 PM Subject: Re: [Dir3d-l] transform riddle
> On 30/1/04 3:02 pm, "Thomas Westin" <thomas.westin@(protected)> wrote: > > > Can someone explain why the result of X3 is not vector(5,7,9) ? > > > > A = TRANSFORM() > > A.TRANSLATE( 1,2,3) > > X1 = VECTOR( 3,3,3) > > X2 = A*X1 > > X3 = 0 > > X3 = A*X2 > > Hi Thomas, > > There is a bug in Director concerning the operation (transform * vector). > Here is the workaround: > > A = TRANSFORM() > A.TRANSLATE( 1,2,3) > X1 = VECTOR( 3,3,3) > X2 = A*X1 + vector(0,0,0) > X3 = 0 > X3 = A*X2 > > put x3 > -- vector( 5.0000, 7.0000, 9.0000 ) > > Cheers, > > James > > __ ____ ____ ____ ____ ____ ____ ____ ____ ____ > Dir3d-l mailing list > Dir3d-l@(protected) > http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l >
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ Dir3d-l mailing list Dir3d-l@(protected) http://nuttybar.drama.uga.edu/mailman/listinfo/dir3d-l
|
|