Skip to content

Origin in left top flips text #9

@bruenor41

Description

@bruenor41

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions