View Full Version : Controling an object
12-10-2001, 06:57 AM
Say that I've 5 quad object.How do I manipulate each object, like when I press an A key the third object will change it color. Can anyone help me?
12-10-2001, 08:33 AM
In the example you suggest, you would respond to the keystroke by calling glColor before the third object is rendered. Something like this:
glColor3*(r, g, b);
How you make this happen in response to the keystroke depends on the system you are using (X, win32, GLUT, etc), and the way your scene rendering code is organized.
12-19-2001, 01:22 AM
Can u explain a little depth. I'm using GLUT to make this program. What this program does actually like this :
I'm rendering a keyboard object that each object represent a key on the keyboard (I hope u got the idea).
When the user press a key on the keyboard say an E key the object that represent the key will change it color and when the user lift up the key the object state will return to the previous color.
Can anyone give an idea.
12-19-2001, 02:30 AM
You mean how do you catch the key press/release?
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.