Hi all,

I know this thread is over a year old but I have a question dealing with this topic. I have just started to code the rubik´s cube and I have a small problem.

At first I must say that I am new to 3DGS.

I have created the cube´s model and began to code the "rotating"-stuff, starting with one side to test it. The code looks like this:

Code:
...
	ecksteinWeissGruenOrange.group = 1;
	kantensteinWeissGruen.group = 1;
	ecksteinWeissGruenRot.group = 1;
	kantensteinGruenRot.group = 1;
	ecksteinGelbGruenRot.group = 1;
	kantensteinGelbGruen.group = 1;
	ecksteinGelbGruenOrange.group = 1;
	kantensteinGruenOrange.group = 1;
	mittelsteinGruen.group = 1;
		
	while( 1 )
	{
		c_ignore( 1, 0 );
		c_rotate( ecksteinWeissGruenOrange, vector(0,time_step*4,0), IGNORE_PUSH | USE_AXIS );
		c_rotate( kantensteinWeissGruen, vector(0,time_step*4,0), IGNORE_PUSH | USE_AXIS );
		c_rotate( ecksteinWeissGruenRot, vector(0,time_step*4,0), IGNORE_PUSH | USE_AXIS );
		c_rotate( kantensteinGruenRot, vector(0,time_step*4,0), IGNORE_PUSH | USE_AXIS );
		c_rotate( ecksteinGelbGruenRot, vector(0,time_step*4,0), IGNORE_PUSH | USE_AXIS );
		c_rotate( kantensteinGelbGruen, vector(0,time_step*4,0), IGNORE_PUSH | USE_AXIS );
		c_rotate( ecksteinGelbGruenOrange, vector(0,time_step*4,0), IGNORE_PUSH | USE_AXIS );
		c_rotate( kantensteinGruenOrange, vector(0,time_step*4,0), IGNORE_PUSH | USE_AXIS );
		c_rotate( mittelsteinGruen, vector(0,time_step*4,0), IGNORE_PUSH | USE_AXIS );
		
		wait( 1 );
	}
        ...



The code works fine but I have one big problem. If the program runs for a while the nine cube´s start to move into each other. I think this is because there is a small delay between the c_rotate functions for these nine cube parts so that they do not really rotate with the same speed.

At the moment I use 3 different cube models which I copy to build the whole cube itself. One centerpiece (6 skins), one edgepiece (12 skins) and one cornerpiece (8 skins).

How could I rotate a whole side of a cube?

Please help me.


Mfg, PlayStefan <img src="/ubbthreads/images/graemlins/smile.gif" alt="" />