chossen-addict
chossen-addict

Reputation: 390

fixed scaling in opengl

can anyone help me out in scaling of opengl. i am using the glScalef() function to scale polygons but what i want is that the scaling is done on a fixed point but it is not achieved with the following function. can some one put some light on this?

Upvotes: 1

Views: 2002

Answers (1)

Damon
Damon

Reputation: 70206

Scaling generally happens around the origin. Therefore, to scale around a point (x,y,z), one must translate the origin, and back.

Specifically:

  • translate by (-x, -y, -z)
  • scale
  • translate by (x, y, z)

Note: it is the very same thing as rotating around a point.

Upvotes: 4

Related Questions