My .c programme using glut creates an object and maps a texture onto that object. This object can then be manipulated by the user. When the object is scaled up then scaled down it moves outside of the window and out of view. How do i make sure the object stayes central when scaling or an alternative cant move outside of the window? I can include my code if needed.
Im thinking if I always scale from the centre of the object this would help but not sure how to do this as it seems to always scale from the corners which is causing it to move out the screen
Ok so the image seems to scale from the centre initially but when the image has been translated, any scaling after this causes it to move?
It sounds as though the scaling operation is not scaling the object from the objects central position which will then cause the object to move away from its origin.
Make sure that you perform the scaling operation before any translation.