🔬 This whole block draws the left arm. What if you change rotateX to rotateY? Will the arm wave forward/backward instead of up/down?
// Left Arm
push();
fill(255, 204, 0); // Yellow skin color
specularMaterial(200);
translate(-50, -10, 0); // Position arm to the left of the body
rotateX(sin(frameCount * 0.05) * 0.1); // Simple waving animation
cylinder(10, 60); // Create the left arm cylinder
pop();
function drawCharacter() {
push();
translate(0, 0, 0); // Keep character centered horizontally
// Head
push();
fill(255, 204, 0); // Yellow skin color
specularMaterial(200); // Shiny plastic-like material
translate(0, -70, 0); // Position head above the body
box(40); // Create the head box
pop();
// Body
fill(0, 0, 255); // Blue shirt color
specularMaterial(200);
box(60, 80, 40); // Create the main body box
// Left Arm
push();
fill(255, 204, 0); // Yellow skin color
specularMaterial(200);
translate(-50, -10, 0); // Position arm to the left of the body
rotateX(sin(frameCount * 0.05) * 0.1); // Simple waving animation
cylinder(10, 60); // Create the left arm cylinder
pop();
// Right Arm
push();
fill(255, 204, 0); // Yellow skin color
specularMaterial(200);
translate(50, -10, 0); // Position arm to the right of the body
rotateX(sin(frameCount * 0.05 + PI) * 0.1); // Simple waving animation (opposite phase)
cylinder(10, 60); // Create the right arm cylinder
pop();
// Left Leg
push();
fill(100, 100, 100); // Grey pants color
specularMaterial(200);
translate(-15, 60, 0); // Position leg to the left and below the body
cylinder(12, 80); // Create the left leg cylinder
pop();
// Right Leg
push();
fill(100, 100, 100); // Grey pants color
specularMaterial(200);
translate(15, 60, 0); // Position leg to the right and below the body
cylinder(12, 80); // Create the right leg cylinder
pop();
pop();
}