开发者

Mirror image in OpenGl

I am new to OpenGl and needed some help. I have a screen was able to draw a imageon it. Now i want to create a mirror image of the same image i.e i want the screen to be divided in 2 parts(horizontally) and then have the actual image at the bottom and create a duplicate image at the top just like 开发者_如何学Goa mirror image so that if a change is made to the bottom image it reflects on the top image too.

Please give suggestions. (I do not want canvas mirror image code)


try this

sprite = BitmapFactory .decodeResource(appContext.getResources(),R.drawable.spritegfx);

Matrix temp1=new Matrix();

temp1.preScale(-1.0f,1.0f);

flipedSprite = Bitmap.createBitmap(sprite , 0, 0,sprite.getWidth(),sprite .getHeight(), temp1, false);

canvas.drawBitmap(flipedSprite , 0,0, null);


http://www.opengl.org/archives/resources/faq/technical/transformations.htm#tran0170

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜