PDA

View Full Version : regarding glScalef()



karteek
03-26-2003, 09:25 PM
The problem is I have dsigned a room and left empty blocks for placing windows.I wrote a seperate routine fo drawing a window which is small than the block in whick it should fit.So i decided to scale the window to fit into it.
But glScalef() is creating a number of problems.If I scale and translate appropriately it is going out of the block.Is there any way of designing this situation easily

shinpaughp
03-26-2003, 09:43 PM
Do your translate and rotate before the scale or scale will affect them also.

oliii
03-28-2003, 05:41 AM
openGL uses a matrix stack, so the operations are performed in 'reverse' order.

what you would normaly do is
scale
rotate
translate
render

you have to do in openGL
glPushMatrix()
glTranslate()
glRotate()
glScale()
render()
glPopMatrix()