本文整理汇总了Java中android.opengl.GLES20.glLineWidth方法的典型用法代码示例。如果您正苦于以下问题:Java GLES20.glLineWidth方法的具体用法?Java GLES20.glLineWidth怎么用?Java GLES20.glLineWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES20
的用法示例。
在下文中一共展示了GLES20.glLineWidth方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawCircle
import android.opengl.GLES20; //导入方法依赖的package包/类
private void drawCircle( float r, float g, float b, float a ) {
for( int i = 0; i < circleBuffersesList.size(); ++i ) {
//頂点バッファの指定
GLES20.glVertexAttribPointer( GLES.positionHandle, 3,
GLES20.GL_FLOAT, false, 0, circleBuffersesList.get(i).vertexBuffer );
//法線バッファの指定
GLES20.glVertexAttribPointer( GLES.normalHandle, 3,
GLES20.GL_FLOAT, false, 0, circleBuffersesList.get(i).normalBuffer );
//描画
setMaterial( r, g, b, a );
circleBuffersesList.get(i).indexBuffer.position(0);
GLES20.glLineWidth( 100f );
GLES20.glDrawElements( GLES20.GL_LINE_LOOP,
circleBuffersesList.get(i).indexBuffer.capacity(), GLES20.GL_UNSIGNED_BYTE, circleBuffersesList.get(i).indexBuffer );
}
}
示例2: drawBar
import android.opengl.GLES20; //导入方法依赖的package包/类
private void drawBar( float r, float g, float b, float a ) {
//頂点バッファの指定
GLES20.glVertexAttribPointer( GLES.positionHandle, 3,
GLES20.GL_FLOAT, false, 0, bar_vertexBuffer );
//法線バッファの指定
GLES20.glVertexAttribPointer( GLES.normalHandle, 3,
GLES20.GL_FLOAT, false, 0, bar_normalBuffer );
//描画
setMaterial( r, g, b, a );
GLES20.glLineWidth( 1f );
bar_indexBuffer.position( 0 );
GLES20.glDrawElements(GLES20.GL_LINE_STRIP,
2, GLES20.GL_UNSIGNED_BYTE, bar_indexBuffer);
float alpha = 0.05f;
for( int i = 0; i < bar_indexBuffer.capacity(); i += 3 ) {
setMaterial( r, g, b, alpha );
alpha -= 0.001f;
bar_indexBuffer.position( i );
GLES20.glDrawElements(GLES20.GL_TRIANGLE_STRIP,
3, GLES20.GL_UNSIGNED_BYTE, bar_indexBuffer);
if( alpha < 0 ) break;
}
}
示例3: drawArcLine
import android.opengl.GLES20; //导入方法依赖的package包/类
private void drawArcLine( float r, float g, float b, float a ) {
//頂点バッファの指定
GLES20.glVertexAttribPointer( GLES.positionHandle, 3,
GLES20.GL_FLOAT, false, 0, arcLine_vertexBuffer );
//法線バッファの指定
GLES20.glVertexAttribPointer( GLES.normalHandle, 3,
GLES20.GL_FLOAT, false, 0, arcLine_normalBuffer );
//描画
setMaterial( r, g, b, a );
arcLine_indexBuffer.position(0);
GLES20.glLineWidth( 7f );
GLES20.glDrawElements( GLES20.GL_LINES,
arcLine_indexBuffer.capacity(), GLES20.GL_UNSIGNED_BYTE, arcLine_indexBuffer );
}
示例4: drawSelf
import android.opengl.GLES20; //导入方法依赖的package包/类
public void drawSelf() {
// 制定使用某套shader程序
GLES20.glUseProgram(mProgram);
// 将最终变换矩阵传入shader程序
GLES20.glUniformMatrix4fv(muMVPMatrixHandle, 1, false,
MatrixState.getFinalMatrix(), 0);
// 为画笔指定顶点位置数据
GLES20.glVertexAttribPointer(maPositionHandle, 3, GLES20.GL_FLOAT,
false, 3 * 4, mVertexBuffer);
// 为画笔指定顶点着色数据
GLES20.glVertexAttribPointer(maColorHandle, 4, GLES20.GL_FLOAT, false,
4 * 4, mColorBuffer);
// 允许顶点位置数据数组
GLES20.glEnableVertexAttribArray(maPositionHandle);
GLES20.glEnableVertexAttribArray(maColorHandle);
GLES20.glLineWidth(10);//设置线的宽度
//绘制点或线
switch (Constant.CURR_DRAW_MODE) {
case Constant.GL_POINTS:// GL_POINTS方式
GLES20.glDrawArrays(GLES20.GL_POINTS, 0, vCount);
break;
case Constant.GL_LINES:// GL_LINES方式
GLES20.glDrawArrays(GLES20.GL_LINES, 0, vCount);
break;
case Constant.GL_LINE_STRIP:// GL_LINE_STRIP方式
GLES20.glDrawArrays(GLES20.GL_LINE_STRIP, 0, vCount);
break;
case Constant.GL_LINE_LOOP:// GL_LINE_LOOP方式
GLES20.glDrawArrays(GLES20.GL_LINE_LOOP, 0, vCount);
break;
}
}
示例5: drawFrameLines
import android.opengl.GLES20; //导入方法依赖的package包/类
private void drawFrameLines( float r, float g, float b, float a ) {
//頂点バッファの指定
GLES20.glVertexAttribPointer( GLES.positionHandle, 3,
GLES20.GL_FLOAT, false, 0, frameLines_vertexBuffer );
//法線バッファの指定
GLES20.glVertexAttribPointer( GLES.normalHandle, 3,
GLES20.GL_FLOAT, false, 0, frameLines_normalBuffer );
//描画
setMaterial( r, g, b, a );
GLES20.glLineWidth( 6f );
// 円の枠線
frameLines_indexBuffer.position( 0 );
GLES20.glDrawElements( GLES20.GL_LINE_LOOP,
frameLines_indexBuffer.capacity()-6, GLES20.GL_UNSIGNED_BYTE, frameLines_indexBuffer );
// 十字線
frameLines_indexBuffer.position( frameLines_indexBuffer.capacity()-6 );
GLES20.glDrawElements( GLES20.GL_LINES,
4, GLES20.GL_UNSIGNED_BYTE, frameLines_indexBuffer );
// 北側
setMaterial( 1, 0, 0, a );
frameLines_indexBuffer.position( frameLines_indexBuffer.capacity()-2 );
GLES20.glDrawElements( GLES20.GL_LINES,
2, GLES20.GL_UNSIGNED_BYTE, frameLines_indexBuffer );
}
示例6: glLineWidth
import android.opengl.GLES20; //导入方法依赖的package包/类
public static void glLineWidth(final float width)
{
//.if DESKTOP
//|gl.glLineWidth(width);
//.elseif ANDROID
GLES20.glLineWidth(width);
//.endif
}
示例7: draw
import android.opengl.GLES20; //导入方法依赖的package包/类
@Override public void draw(ShaderProgram shaderProgram) {
GraphShaderProgram graphShaderProgram = (GraphShaderProgram) shaderProgram;
GLES20.glLineWidth(graphInfo.getLineWidth());
GLES20.glUniform4f(graphShaderProgram.getColorLocation(), graphInfo.getRed(), graphInfo.getGreen(), graphInfo.getBlue(), 1.0f);
GLES20.glDrawArrays(GLES20.GL_LINE_STRIP, 0, SENSOR_HISTORY_LENGTH);
}