Does anyone know how I can transform a standard 3x4 computer vision
matrix to a 4x4 opengl matrix? What row do I have to add? And what
additional transformation do I have to perform on the matrix?
RRRT
RRRT
RRRT
SSSx
Where R is the rotation, T the translation and S scaling.
HTH,
GF
I tried to use a projection matrix in opengl that looks like this:
a11 ..... a14
a21 ..... a24
a31 a32 a33 dx
a31 ..... a34
but that didn't work...
Nope.
The scale is mixed in with the rotation. It definitely
isn't separate.
Secondly, the matrices might look like that in the man
pages but they don't look like that in memory. In memory
the translation is along the bottom.
SRR0
RSR0
RRS0
TTT1
--
<\___/> For email, remove my socks.
/ O O \
\_____/ FTB. Why isn't there mouse-flavored cat food?
Thank you, I wasn't sure about that anymore.
> Secondly, the matrices might look like that in the man
> pages but they don't look like that in memory. In memory
> the translation is along the bottom.
>
> SRR0
> RSR0
> RRS0
> TTT1
The right column is 0001? I thought it's neccessary data there? I know
the last one must be a '1', since it's not used...
-Gernot
So in which order would I have to fill a buffer to use with
glLoadMatrix? SRRTRSRTRRST0001? And why is the last column 0001? I am
not using a uniform scaling- so the last column would be different to right?
>
>
> fungus wrote:
>
>>
>> the matrices might look like that in the man
>> pages but they don't look like that in memory. In memory
>> the translation is along the bottom.
>>
>> SRR0
>> RSR0
>> RRS0
>> TTT1
>
>
> So in which order would I have to fill a buffer to use with
> glLoadMatrix? SRRTRSRTRRST0001?
Nope. SRR0SRR0SRR0TTT1
> And why is the last column 0001?
> I am not using a uniform scaling.
>
It can be something else in the perspective matrix but
in a modelview matrix made with scale/rotate/translate
it's *always* 0001.
Thanks for the information. I see if I can get some good results with
that. Can I leave the modelview matrix just as it is (the identity
matrix) and use the projection to load my values? I thought opengl just
multiplies all the matrices anyway. Or how would you go about?
>
> Can I leave the modelview matrix just as it is (the identity
> matrix) and use the projection to load my values?
>
You can if you want to, but:
a) There's no point. It won't be faster or anything.
b) Lighting and fogging won't work (among other things).