transform riddle 2004-01-30 - By Thomas Higgins
Back > 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
Yup, James is 100% correct. When you do (transform*vector) the resulting vector has a fourth w-component value of zero, therefore if you use that result again doing (transform*resultVector) then you don't get any of the translational components and so in the case provided the result is (4,5,6) instead of (5,7,9) (notice the lack of translation of (1,2,3)?).
The workaround does the trick as it forces the result vector to take on a w-component of 1 and thus later transform*vector operations work as expected.
Cheers, Tom Higgins Product Specialist - Director Team Macromedia
Announcing Director MX 2004, de lekkerste! http://www.macromedia.com/software/director
...
> -- --Original Message-- -- > From: dir3d-l-bounces@(protected) > [mailto:dir3d-l-bounces@(protected)] On Behalf Of > James Newton > Sent: Friday, January 30, 2004 9:26 AM > To: dir3d-l@(protected) > 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, >
> > 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
|
|