Re: matrix multiply of vector

"Philippe C.D. Robert" <[email protected]> Sat, 6 Jul 2002 18:15:04 +0200
Newsgroups gmane.comp.gnu.3dkit.general
Message-ID <[email protected]>
Hi,
On Friday, July 5, 2002, at 11:53 PM, Brent Gulanowski wrote:
> Pursuant to my questions about "Bugs?" on the bug list,
>
> I have a thing I'm trying to do, which I'm sure I'll scrap for an 
> entirely better solution soon, but currently this requires that I apply 
> a scale matrix multiplication to a vector3f. In this case, I want to 
> mirror the vector in the z-axis, and then set the scale of a transform 
> to that vector.
>  It's kind of the wrong application, but assuming I find a use for what 
> is a standard 3D operation, does 3DKit have a way for me to do it 
> properly?

Hmm, I am not entirely sure what you mean... If I get you right then you 
would multiply your vector with the mirror matrix ( see 
vectorByPreMultiplying: ) and after that you'd call setScaleValues: on 
the transform passing your new vector.

The mirror matrix looks like

1  0  0  0
0  1  0  0
0  0 -1  0
0  0  0  1

BTW please be aware that you should always use 4 dimensions when doing 
3D graphics, thus you would use a G3DVector4f!

-Phil
--
Philippe C.D. Robert
http://www.nice.ch/~phip