P5 Python Docs
  • Getting Started
  • Simple mode
  • Reference
    • Shapes
      • 2D
        • point()
        • line()
        • rect()
        • square()
        • triangle()
        • circle()
        • ellipse()
        • arc()
        • quad()
        • beginShape()
      • 3D
        • plane()
        • box()
        • sphere()
        • cone()
        • cylinder()
        • ellipsoid()
        • torus()
    • Controlling the environment
      • coordinateMode()
      • rectMode()
      • ellipseMode()
      • frameRate()
      • setup()
      • draw()
    • Built-in Variables
      • Environment
      • Keyboard
      • Mouse
    • Built-in Functions
      • keyIsDown()
      • millis()
      • second()
      • minute()
      • hour()
      • translate()
      • rotate()
      • createSlider()
      • createGraphics()
      • createVector()
    • Events
      • Keyboard
        • keyPressed()
        • keyReleased()
      • Mouse
        • mouseMoved()
        • mouseDragged()
        • mousePressed()
        • doubleClicked()
        • mouseWheel()
    • Text
      • text()
      • textSize()
      • textAlign()
    • Math
      • drawTickAxes()
      • random()
      • randomGaussian()
      • dist()
      • linmap()
      • bounce()
      • wave()
    • Colour and Outline
      • colorMode()
      • fill()
      • stroke()
      • strokeWeight()
      • background()
    • Images & Audio
      • loadImage() and image()
      • loadSound()
    • 3D Controls
      • orbitControl()
      • translate()
      • rotateZ()
      • rotateX()
      • rotateY()
      • scale()
Powered by GitBook
On this page
  • Example
  • Syntax
  • Description
  1. Reference
  2. Shapes
  3. 3D

plane()

Plane - Draws a flat 2D bounded surface in 3D

Previous3DNextbox()

Last updated 2 years ago

Example

Syntax

plane([width], [height], [detailX], [detailY])
Parameter
Description

width

width of the plane

height

height of the plane

Example Full Code
def setup():
  createCanvas(300,300, WEBGL)

def draw():
  background(255, 79, 132)
  orbitControl()
  stroke(176, 235, 51)
  fill(112, 88, 255)
  strokeWeight(2)

  r = frameCount
  rotateX(r)
  rotateY(-r)
  rotateZ(r)
  plane(200, 100)

Description

draws a plane of a specified width and height in the x-y plane. So, the width is the length in the x-direction, where the height is the length in the y-direction.

Find these documents helpful? Let the people who made them help your child learn to code at !

We'd love to hear your Feedback/Comments .

Strivemath
here