Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

diehard89

macrumors newbie
Original poster
Mar 19, 2008
5
0
Singapore
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.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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?
 

diehard89

macrumors newbie
Original poster
Mar 19, 2008
5
0
Singapore
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.