Java Code Examples for javax.microedition.khronos.opengles.GL10#GL_FALSE

The following examples show how to use javax.microedition.khronos.opengles.GL10#GL_FALSE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GLUES.java    From PanoramaGL with Apache License 2.0 5 votes vote down vote up
public static int gluUnProject(float winx, float winy, float winz,
                float model[], int offsetM,
                float proj[], int offsetP,
                int viewport[], int offsetV,
                float[] xyz, int offset)
{
	//return GLU.gluUnProject(winx, winy, winz, model, offsetM, proj, offsetP, viewport, offsetV, xyz, offset);
	/*Transformation matrices*/
	//float[] m = new float[16], A = new float[16];
	//float[] in = new float[4], out = new float[4];

	/*Normalize between -1 and 1*/
	gluUnProjectData[offsetIn]   = (winx - viewport[offsetV]) * 2.0f / viewport[offsetV+2] - 1.0f;
	gluUnProjectData[offsetIn+1] = (winy - viewport[offsetV+1]) * 2.0f / viewport[offsetV+3] - 1.0f;
	gluUnProjectData[offsetIn+2] = 2.0f * winz - 1.0f;
	gluUnProjectData[offsetIn+3] = 1.0f;

	android.opengl.Matrix.multiplyMM(gluUnProjectData, offsetA, proj, offsetP, model, offsetM);
	com.panoramagl.opengl.matrix.Matrix.invertM(gluUnProjectData, offsetModel, gluUnProjectData, offsetA);

	android.opengl.Matrix.multiplyMV(gluUnProjectData, offsetOut, gluUnProjectData, offsetModel, gluUnProjectData, offsetIn);
	if(gluUnProjectData[offsetOut+3] == 0.0)
		return GL10.GL_FALSE;
	
	xyz[offset]   = gluUnProjectData[offsetOut  ] / gluUnProjectData[offsetOut+3];
	xyz[offset+1] = gluUnProjectData[offsetOut+1] / gluUnProjectData[offsetOut+3];
	xyz[offset+2] = gluUnProjectData[offsetOut+2] / gluUnProjectData[offsetOut+3];
	return GL10.GL_TRUE;
}
 
Example 2
Source File: GLUES.java    From panoramagl with Apache License 2.0 5 votes vote down vote up
public static int gluUnProject(float winx, float winy, float winz,
                               float model[], int offsetM,
                               float proj[], int offsetP,
                               int viewport[], int offsetV,
                               float[] xyz, int offset) {
    //return GLU.gluUnProject(winx, winy, winz, model, offsetM, proj, offsetP, viewport, offsetV, xyz, offset);
    /*Transformation matrices*/
    //float[] m = new float[16], A = new float[16];
    //float[] in = new float[4], out = new float[4];

    /*Normalize between -1 and 1*/
    gluUnProjectData[offsetIn] = (winx - viewport[offsetV]) * 2.0f / viewport[offsetV + 2] - 1.0f;
    gluUnProjectData[offsetIn + 1] = (winy - viewport[offsetV + 1]) * 2.0f / viewport[offsetV + 3] - 1.0f;
    gluUnProjectData[offsetIn + 2] = 2.0f * winz - 1.0f;
    gluUnProjectData[offsetIn + 3] = 1.0f;

    android.opengl.Matrix.multiplyMM(gluUnProjectData, offsetA, proj, offsetP, model, offsetM);
    com.panoramagl.opengl.matrix.Matrix.invertM(gluUnProjectData, offsetModel, gluUnProjectData, offsetA);

    android.opengl.Matrix.multiplyMV(gluUnProjectData, offsetOut, gluUnProjectData, offsetModel, gluUnProjectData, offsetIn);
    if (gluUnProjectData[offsetOut + 3] == 0.0)
        return GL10.GL_FALSE;

    xyz[offset] = gluUnProjectData[offsetOut] / gluUnProjectData[offsetOut + 3];
    xyz[offset + 1] = gluUnProjectData[offsetOut + 1] / gluUnProjectData[offsetOut + 3];
    xyz[offset + 2] = gluUnProjectData[offsetOut + 2] / gluUnProjectData[offsetOut + 3];
    return GL10.GL_TRUE;
}
 
Example 3
Source File: RenderFeature2.java    From geoar-app with Apache License 2.0 5 votes vote down vote up
public float[] onScreenCoordsUpdate() {
	if (modelMatrix == null || GLESCamera.projectionMatrix == null
			|| GLESCamera.viewportMatrix == null) {
		return null;
	}
	float[] output = new float[3];
	int res = GLU.gluProject(position[0], position[1], position[2],
			modelMatrix, 0, GLESCamera.projectionMatrix, 0,
			GLESCamera.viewportMatrix, 0, output, 0);

	if (res == GL10.GL_FALSE)
		return null;
	return output;
}
 
Example 4
Source File: GLUES.java    From PanoramaGL with Apache License 2.0 4 votes vote down vote up
/**quadric methods*/

public static GLUquadric gluNewQuadric()
{
	return new GLUquadric(GLU_SMOOTH, GL10.GL_FALSE, GLU_OUTSIDE, GLU_FILL, null);
}
 
Example 5
Source File: GLUES.java    From PanoramaGL with Apache License 2.0 4 votes vote down vote up
public static void gluQuadricTexture(GLUquadric qobj, boolean textureCoords)
{
	qobj.textureCoords = (textureCoords ? GL10.GL_TRUE : GL10.GL_FALSE);
}
 
Example 6
Source File: GLUES.java    From panoramagl with Apache License 2.0 4 votes vote down vote up
/**
 * quadric methods
 */

public static GLUquadric gluNewQuadric() {
    return new GLUquadric(GLU_SMOOTH, GL10.GL_FALSE, GLU_OUTSIDE, GLU_FILL, null);
}
 
Example 7
Source File: GLUES.java    From panoramagl with Apache License 2.0 4 votes vote down vote up
public static void gluQuadricTexture(GLUquadric qobj, boolean textureCoords) {
    qobj.textureCoords = (textureCoords ? GL10.GL_TRUE : GL10.GL_FALSE);
}