How to draw a dotted line dynamically using OpenGL ES 2.0 in Android programmatically? -


i new opengl es 2.0 android. trying draw dashed line in opengl es 2.0 in android programmatically. found more ways opengl es 1.0 only.

can give me suggestion or opengl es 2.0 sample code android?

i found better solution. use horizontal , vertical lines.

#define dot_vertex_code \   "attribute vec4 a_position;" \   "uniform mat4 projectionmatrix;" \   "varying vec2 v_xy;" \   "void main() {gl_pointsize = 1.0; gl_position = a_position*projectionmatrix; v_xy = a_position.xy;}"  #define dot_fragment_code \   "precision mediump float;" \   "varying vec2 v_xy;" \   "uniform float isvert;" \   "uniform vec4 color1;" \   "uniform vec4 color2;" \   "void main() {gl_fragcolor = mod(isvert > 0.0 ? v_xy.y : v_xy.x, 2.0) >= 1.0 ? color1 : color2;}" 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -