I toyed around with some extremely basic openGL code today. My first impression of openGL is ~ugh~ I don’t like anything about it. It feels very archaic, overly difficult. I wanted to use touch to rotate a 3D cube, but something as seemingly simplistic as that requires 500 lines of code in just 1 class. I didn’t feel like diving into that especially when I just wanted to toy around.
I did learn one neat trick, something I want to remember. Using system time to rotate a 3D cube.
(also learned to use system time to conserve cpu power)
long time = SystemClock.uptimeMillis() % 4000L; float angle = .090f * ((int)time); gl.glRotatef(angle, 1, 0, 1); cube.draw(gl);