View Full Version : Scaling method
Aug 26, 2008, 12:29 PM
Is there any method to scale just the bottom half of an image, such as functions,etc...
For example, a square with width 10 and height 10.
After scaling, the top width of the square remains 10,but the bottom width is 5.(Height remain the same)
Thanks in advance.
Aug 26, 2008, 12:43 PM
You don't really mean scaling do you? You mean to transform the image so it looks like it has perspective (so that the image is projected onto a trapezoid).
I think you can perform this transform using CoreGraphics calls although I am unable to provide details as I'm not on a Mac right now. Perhaps if you read the documentation you can work it out for yourself?
Aug 26, 2008, 12:53 PM
ya,some kind of transformation, I will see if i can find it in the documentation.
Aug 26, 2008, 01:33 PM
Hmm, looking at the documentation CoreGraphics only seems to have affine transformations. You need a non-affine transform. Perhaps you need to be looking at OpenGL?
Aug 26, 2008, 02:35 PM
been looking in opengl ES but did not find much info on how to do it.
Aug 28, 2008, 11:02 AM
In openGL, i bind the textures onto a quad made of GL_TRIANGLE_STRIP
but if i move in the bottom vertex of the Quad that made up of Triangle strip,
the texture that bind onto it will be distorted and not properly render.