View Full Version : Two objects
03-12-2012, 04:46 PM
Hello... I have just started using GLUT, and I can't figure out how I can make to have on the screen two object at the same time, that are "activated" by keyboard...
Lets say i have 2 cubes, one appears on 'a' one on 'b'... But when I press 'b', the 1st one dissapears... I can't really figure it out...
03-12-2012, 05:51 PM
GLUT does not control OpenGL drawing; you control what is drawn by the code inside the procedure set in glutDisplayFunc. If you want 2 cubes draw you must draw 2 cubes each time that procedure is called. You may need to post this procedure if you want more information
03-13-2012, 02:14 AM
glColor3f(0.0f, 1.0f, 1.0f);
glColor3f(1.0f, 1.0f, 1.0f);
So this is how it looks like... If you need more of the code just tell. :P
And same problem with an cube that is rotating around (0,0,0), i want to keep all the possitions.
03-13-2012, 03:59 AM
As tonyo_au already pointed out you see only one cube as you only draw one: as the variable "tasta" may only hold one value it may be either 'a' or 's' (or something else in which case probably nothing is displayed).
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.