Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float[] modelViewMatrixKeyframe2 = Tool.convertPose2GLMatrix(trackableResult.getPose()).getData();
- float[] modelViewProjectionKeyframe2 = new float[16];
- Matrix.translateM(
- modelViewMatrixKeyframe2, 0,
- config.get("color_x").floatValue() + config.get("color_space_h").floatValue() * (i % config.get("color_number_in_line").intValue()),
- config.get("color_y").floatValue() + config.get("color_space_v").floatValue() * (i / config.get("color_number_in_line").intValue()),
- config.get("color_z").floatValue()
- );
- Matrix.rotateM(modelViewMatrixKeyframe2, 0, 270, 0, 0, 1);
- Matrix.rotateM(modelViewMatrixKeyframe2, 0, 90, 1, 0, 0);
- Matrix.rotateM(modelViewMatrixKeyframe2, 0, 90, 0, 1, 0);
- Matrix.scaleM(modelViewMatrixKeyframe2, 0, config.get("color_scale").floatValue(), config.get("color_scale").floatValue(), config.get("color_scale").floatValue());
- Matrix.multiplyMM(modelViewProjectionKeyframe2, 0, vuforiaAppSession.getProjectionMatrix().getData(), 0, modelViewMatrixKeyframe2, 0);
- Matrix44F matrix44F = new Matrix44F();
- matrix44F.setData(modelViewMatrixKeyframe2);
- modelViewMatrix_colors.put(colors_list.get(i).getSet_id() + "_" + colors_list.get(i).getId(), matrix44F);
- GLES20.glUseProgram(keyframeShaderID);
- GLES20.glEnableVertexAttribArray(keyframeVertexHandle);
- //GLES20.glEnableVertexAttribArray(keyframeNormalHandle);
- GLES20.glEnableVertexAttribArray(keyframeTexCoordHandle);
- // Prepare for rendering the keyframe
- GLES20.glVertexAttribPointer(keyframeVertexHandle, 3, GLES20.GL_FLOAT, false, 0, fillBuffer(ArrayUtils.toPrimitive(Verts_colors.toArray(new Double[Verts_colors.size()]))));
- //GLES20.glVertexAttribPointer(keyframeNormalHandle, 3, GLES20.GL_FLOAT, false, 0, fillBuffer(ArrayUtils.toPrimitive(Normals.toArray(new Double[Normals.size()]))));
- GLES20.glVertexAttribPointer(keyframeTexCoordHandle, 2, GLES20.GL_FLOAT, false, 0, fillBuffer(ArrayUtils.toPrimitive(TexCoords_colors.toArray(new Double[TexCoords_colors.size()]))));
- GLES20.glEnable(GLES20.GL_BLEND);
- GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
- GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
- GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, colors_texture.get(colors_list.get(i).getId()).mTextureID[0]);
- GLES20.glUniformMatrix4fv(keyframeMVPMatrixHandle, 1, false, modelViewProjectionKeyframe2, 0);
- GLES20.glUniform1i(keyframeTexSampler2DHandle, 0);
- GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, NumVerts_colors);
- GLES20.glDisable(GLES20.GL_BLEND);
- GLES20.glDisableVertexAttribArray(keyframeVertexHandle);
- //GLES20.glDisableVertexAttribArray(keyframeNormalHandle);
- GLES20.glDisableVertexAttribArray(keyframeTexCoordHandle);
- GLES20.glUseProgram(0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement