Ejemplo n.º 1
0
void update2(double value) {
	

	//goal = Point3f(cos(angle*PI / 180.0f), sin(angle*PI / 180.0f), (sin(zangle*PI / 180.0f)));
	//Point3f goal(cos(angle*PI/180.0f), sin(angle*PI/180.0f), 0);

	//goal.normalize();
	//goal *= 5;

	//goal += Vector3f(-3, 0, -1);
	//goal = Vector3f(0, 0, 7);
	//mainArm.solve(goal, 100);
	//Point3f secGoal = Point3f(goal[0], goal[1], -goal[2]);
	//secArm.solve(secGoal, 100);

	//display();

	for (int i = 0; i < 50; i++) {
		if (i>20) {
	goal = Point3f(3, 0, 1);
	//goal += Vector3f(20, 4, 4);
	mainArm.solve(goal, 100);
	display();
		}
	}

	for (int i = 0; i < 50;i++){
		if(i>25){
	goal = Vector3f(value+3, 0, 3);
	mainArm.solve(goal, 100);
	display();
		}
	}
}
Ejemplo n.º 2
0
void update() {
	angle += 360.0 / 60.0;
	zangle += 360.0f / 100.0f;

	//goal = Point3f(cos(angle*PI / 180.0f), sin(angle*PI / 180.0f), (sin(zangle*PI / 180.0f)));
	//Point3f goal(cos(angle*PI/180.0f), sin(angle*PI/180.0f), 0);

	//goal.normalize();
	//goal *= 5;

	//goal += Vector3f(-3, 0, -1);
	//goal = Vector3f(0, 0, 7);
	//mainArm.solve(goal, 100);
	//Point3f secGoal = Point3f(goal[0], goal[1], -goal[2]);
	//secArm.solve(secGoal, 100);

	//display();


	
	goal = Vector3f(20, 4, 4);
	mainArm.solve(goal, 100);
	display();
	



}