Original Post
Hi guys
I’ve got a translation problem in my OpenGL code(programming in windows). Basically I’ve created a sphere in a method called renderScene doing the usual
pushMatrix
create sphere object
translate
create sphere
pop matrix.
In another method called move which is called on a key stoke I’ve setup a while loop which for example is from 0.0001 to 1 do with an increment of 0.0001.
After each pass I want to translate my sphere by these small increases. The problem is I can’t just update the x,y,z co-ordinates I used in the glTranslate because I have to call renderScene to make this happen.
The problem with calling renderScene is that it will create a new sphere on top of the current sphere(snake effect), where as I want to just move the old sphere. What I really need is to be able to get a handle on my sphere object which will then allow me to call glTranslate from my move method. The problem is I don’t know if you can or how to get a handle on a sphere object.
It’s hard to explain the problem so if anything’s not clear let me know. Cheers and I hope someone can help.