GSDP:GAM100/CProcessing/rotate()

From Inside
Jump to: navigation, search

rotate()

Description

Rotates the whole canvas about the upper left corner of the window by the input degrees.

Parameters

rotate(float degrees)

  • degrees - (float) The amount to rotate the canvas by

Example

void update()
{
    // Draw a white backround
    background(color(255, 255, 255, 255));
	
    // Rotate the canvas 
    rotate(t_counter);

    // Draw a red square in the center of the screen
    rectMode(CENTER);
    rect(canvasWidth / 2, canvasHeight / 2, 100, 100);

    // Update the counter
    t_counter = t_counter <= 360 ? t_counter + 1 : 0;
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>