GSDP:GAM100/CProcessing/triangleRotated()

From Inside
Jump to: navigation, search

triangleRotated()

Description

A specialized version of the triangle() function which allows the user to specify a rotation (in degrees). The rotation is always about the center of the triangle.

Parameters

triangleRotated(x1, y1, x2, y2, x3, y3, d)

  • x1 - (float) the first point's horizontal position
  • y1 - (float) the first point's vertical position
  • x2 - (float) the second point's horizontal position
  • y2 - (float) the second point's vertical position
  • x3 - (float) the third point's horizontal position
  • y3 - (float) the third point's vertical position
  • d - (float) the rotation in degrees

Example

void update() 
{
    // A triangle drawn based on the points (100, 100), (125, 150), (75, 150)
    // with a rotation of 15 degrees
    triangleRotated(100.0f, 100.0f, 125.0f, 150.0f, 75.0f, 150.0f, 15.0f);
}

Related

Personal tools
Namespaces

Variants
Actions
Navigation
NameSpaces:>
Tools
Dynamic:>