PDA

View Full Version : Analog Clock using OpenGL ES



sumit
01-13-2012, 12:30 AM
I am looking for some directions as i am new to OpenGL.

My objective is to create an Analog clock and display some text inside the clock. So far the directions i have received are to use OpenGl ES and Debian because i am developing for Raspberrypi. These are my specific questions:

1. My guess is this kind of work has been done before, is there any place where i can look for sample code?

2. If not than i am certainly open to deep dive into graphic world, i am looking for directions on how this can be done on Debian.

Thanks,
Sumit

thokra
01-13-2012, 02:28 PM
1. My guess is this kind of work has been done before, is there any place where i can look for sample code?

Yes. And you used it to post here. Maybe you should google for internet. ;)

This task isn't specific Debian - or to any other Linux distro. The problem you're gonna have is to pick a suitable library for rendering text. There's nothing official of the sort.

In general you can start by drawing an approximate circle using a triangle fan. Then render the numbers (as soon as you find a font or text rendering API). Then draw three (or two) lines from the center with a certain radius to simulate the fingers.

Furthermore, this isn't an GLES forum. Check out the Khronos GLES board.

sumit
01-14-2012, 08:28 AM
Thanks Thokra for your response this information will help and i love getting pointed in right direction.

dorbie
01-14-2012, 07:26 PM
I'm very interested in the Raspberry Pi, do you have one or are you just anticipating getting one?

It is important for you to determine if the platform will support OpenGL ES 1.0 or OpenGL ES 2.0. I checked and it's OpenGL ES 2.0, you'll probably need a separate library to get the OpenGL ES 2.0 API on Debian.

They are very different, being fixed function vs programmable and 2.0 does not have backwards compatible features like ftransform or fixed function attributes. It is a completely blank slate for shaders to be written on.