I am new to Android and OpenGL both. I want to draw a series of 3D given points in android with open GL where last point should blink. I have drawn square, pyramid and triangle but still not able to draw above-mentioned thing. Easy method will be appreciated.
Asked
Active
Viewed 1,440 times
1 Answers
1
You can draw points by using GL_POINTS mode if you're running OpenGL ES 1.0 or 1.1, with 2.0+ you need to perform some trickery in order to draw points
Apparantly 2.0 supports point sprites too(see comments below), so the simplest answer is to use point sprites
You can either draw circles formed from triangles or quads that are textured with circles
Drawing points doesn't differiate in any way from drawing any other shapes, you should just use different drawing mode assuming you're using fixed pipeline, or draw points by drawing cirlces or textured quads

Pasi Matalamäki
- 1,843
- 17
- 14
-
Isn't there any method to draw given point/pixel? we can increase size of pixel. – user29671 Apr 24 '15 at 06:02
-
So you basically want to fill one pixel in the viewport? Can you please give a more specific description of the problem you're trying to solve? If you wan't to fill one pixel on the screen, you should draw a texture filling whole viewport and with the size of your viewport and modify the texture with glTexSubImage2D call – Pasi Matalamäki Apr 24 '15 at 06:04
-
I want to plot points like point plotted in this link. http://hotmath.com/learning_activities/interactivities/3dplotter.swf – user29671 Apr 24 '15 at 06:13
-
That is not a point, its a sphere. You can draw sphere that is formed from triangles in exactly the same way you draw a cube or a pyramid – Pasi Matalamäki Apr 24 '15 at 06:16
-
after drawing a cube/pyramid (https://www3.ntu.edu.sg/home/ehchua/programming/android/Android_3D.html) like this.. what to do next? – user29671 Apr 24 '15 at 06:18
-
1Why couldn't you draw points in ES 2.0? It's fully supported, including the possibility to draw general point sprites. See for example my answer here: http://stackoverflow.com/questions/28254209/how-to-draw-a-star-in-ios-opengl-es-2-0/28256170#28256170. Or this one, which is for OpenGL, but mostly applies to ES as well: http://stackoverflow.com/questions/27098315/render-large-circular-points-in-modern-opengl. – Reto Koradi Apr 24 '15 at 06:21
-
On the tutorial you're drawing a triangle from points, then just create the points that form a sphere or a circle and draw it or as Reto said, it looks like ES 2.0 supports point sprites after all just draw the vertices as point sprites and you'll get result you're looking for – Pasi Matalamäki Apr 24 '15 at 06:26
-
Thanks, Pasi Matalamaki and @RetoKoradi. – user29671 Apr 24 '15 at 06:42
-
I found using GL_POINTS unreliable in 3.2. It worked for late model samsung phones but not on other devices or the emulator. Unfortunate, as having to code triangles myself to approximate circles or spheres is less elegant nor efficient. – Androidcoder Aug 21 '20 at 17:39