Function macroquad::models::draw_affine_parallelogram

source ·
pub fn draw_affine_parallelogram(
    offset: Vec3,
    e1: Vec3,
    e2: Vec3,
    texture: Option<&Texture2D>,
    color: Color
)
Expand description

Draw an affine (2D) parallelogram at given position, as two triangles.

The drawn parallelogram will have the vertices: offset, offset + e1, offset + e2 and offset + e1 + e2

§Arguments

  • offset - Offset of the first point from the origin
  • e1, e2 - Base vectors for the parallelogram
  • texture - Optional Texture2D to apply, which will be streched on the entire shape (todo! support custom uv values per vertex)
  • color - The Color to draw the parallelogram

§Examples

Draw an axis aligned rectangle

draw_affine_parallelogram(Vec3::ZERO, 3. * Vec3::X, 5. * Vec3::Z, None, RED);