View Full Version : Skewing with a matrix ?
Hi,
I am a beginning opengl'r
I need to skew an object in the x.
IE the height*a factor get subtracted from the x...
How do I do this with a matrix ?
Any help greatly appreciated.
Greg.
well... you can't http://www.opengl.org/discussion_boards/ubb/smile.gif the easiest way (I think) is to do this for each vertex's coordinates separately. Think: You would have to do glTraslatef() for each vertex, not mentioning it's impossible to do anything with matrix between glBegin() and glEnd()
mogumbo
06-13-2003, 09:40 AM
It sounds like you might be able to use a shear matrix. A shear matrix that does something like you're describing might look like this:
1 0 0 0
n 1 0 0
0 0 1 0
0 0 0 1
mogumbo,
Thanks, that was exactly what I needed.
Simple too.
Need to pick up a guide on matrices.
greg.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.