box

conecljs

cylindercljs

ellipsoidcljs

planecljs

sphere

sphere-detailclj

toruscljs

box

Arguments
[width height depth][size]
Docstring

Creates an extruded rectangle.

Works only inside sketch functions?
Yes
Original Processing method
box()
Original p5js method
box()
Example
(q/camera 200 200 200 0 0 0 0 0 -1)
(q/with-translation [100 0 0]
  (q/box 70))
(q/with-translation [0 100 0]
  (q/box 70 100 50))
try example

conecljs

Arguments
[radius height][radius height detail-x detail-y][radius height detail-x detail-y cap][radius height detail-x]
Docstring

Draw a cone with given radius and height.

  Optional parameters:
  * `detail-x` - number of segments, the more segments the smoother geometry default is 24
  * `detail-y` - number of segments, the more segments the smoother geometry default is 24
  * `cap`      - whether to draw the base of the cone
Works only inside sketch functions?
Yes
Original Processing method
None.
Original p5js method
cone()
Example
clojurescript specific
  • (q/rotate-x (* q/PI 1.25))
    (q/cone 80 140)
    try example

cylindercljs

Arguments
[radius height][radius height detail-x detail-y bottom-cap top-cap]
Docstring

Draw a cylinder with given radius and height.

Works only inside sketch functions?
Yes
Original Processing method
None.
Original p5js method
cylinder()
Example
clojurescript specific
  • (q/rotate-x (* q/PI 1.25))
    (q/cylinder 40 140)
    try example

ellipsoidcljs

Arguments
[radius-x radius-y radius-z][radius-x radius-y radius-z detail-x][radius-x radius-y radius-z detail-x detail-y]
Docstring

Draws an ellipsoid with given radius

  Optional parameters:
  * `detail-x` - number of segments, the more segments the smoother geometry default is 24
  * `detail-y` - number of segments, the more segments the smoother geometry default is 16
Works only inside sketch functions?
Yes
Original Processing method
None.
Original p5js method
ellipsoid()
Example
clojurescript specific

planecljs

Arguments
[width height]
Docstring

Draw a plane with given width and height.

Works only inside sketch functions?
Yes
Original Processing method
None.
Original p5js method
plane()
Example

There are no examples for this function. You can request examples which will help us to prioritize this funciton.

sphere

Arguments
[radius]
Docstring

Generates a hollow ball made from tessellated triangles.

Works only inside sketch functions?
Yes
Original Processing method
sphere()
Original p5js method
sphere()
Example
(q/camera 200 200 200 0 0 0 0 0 -1)
(q/sphere 150)
try example

sphere-detailclj

Arguments
[ures vres][res]
Docstring

Controls the detail used to render a sphere by adjusting the number of vertices of the sphere mesh. The default resolution is 30, which creates a fairly detailed sphere definition with vertices every 360/30 = 12 degrees. If you're going to render a great number of spheres per frame, it is advised to reduce the level of detail using this function. The setting stays active until sphere-detail is called again with a new parameter and so should not be called prior to every sphere statement, unless you wish to render spheres with different settings, e.g. using less detail for smaller spheres or ones further away from the camera. To control the detail of the horizontal and vertical resolution independently, use the version of the functions with two parameters.

Works only inside sketch functions?
Yes
Original Processing method
sphereDetail()
Original p5js method
None.
Example
clojure specific
  • (q/camera 200 200 200 0 0 0 0 0 -1)
    (q/sphere-detail 30)
    (q/with-translation [0 0 100]
      (q/sphere 70))
    (q/sphere-detail 15)
    (q/with-translation [100 0 0]
      (q/sphere 70))
    (q/sphere-detail 30 5)
    (q/with-translation [0 100 0]
      (q/sphere 70))

toruscljs

Arguments
[radius tube-radius][radius tube-radius detail-x][radius tube-radius detail-x detail-y]
Docstring

Draw a torus with given radius and tube-radius.

  Optional parameters:
  * `detail-x` - number of segments, the more segments the smoother geometry default is 24
  * `detail-y` - number of segments, the more segments the smoother geometry default is 16
Works only inside sketch functions?
Yes
Original Processing method
None.
Original p5js method
torus()
Example
clojurescript specific
  • (q/rotate-x (/ q/PI 4))
    (q/torus 70 20)
    try example