Texample2 icon indicating copy to clipboard operation
Texample2 copied to clipboard

Origin in left top flips text

Open bruenor41 opened this issue 6 years ago • 0 comments

Hi,

I changed content of OnSurfaceChanged function with code which sets origin to left top corner. But after that is text flipped. Please can someone help to fix it?

public void onSurfaceChanged(GL10 unused, int width, int height) { 
	GLES20.glViewport(0, 0, width, height);

	for(int i=0;i<16;i++)
	{
		mtrxProjection[i] = 0.0f;
		mtrxView[i] = 0.0f;
		mtrxProjectionAndView[i] = 0.0f;
	}

	Matrix.orthoM(mtrxProjection, 0, 0, width, height, 0, -1, 1);
	Matrix.setLookAtM(mtrxView, 0,
			0f, 0f, 1f,
			0f, 0f, 0f,
			0f, 1.0f, 0.0f);
	Matrix.multiplyMM(mtrxProjectionAndView, 0,
			mtrxProjection, 0,
			mtrxView, 0);
}

// Our matrices
private final float[] mtrxProjection = new float[16];
private final float[] mtrxView = new float[16];
private final float[] mtrxProjectionAndView = new float[16]; 

Many thanks

bruenor41 avatar Oct 08 '18 14:10 bruenor41