Package rope.core

Class R_Graphic

All Implemented Interfaces:
R_Constants, R_Constants_Colour
Direct Known Subclasses:
Crope, R_Bloc, R_Brick_SVG, R_Costume_Pict, R_Face, R_Line2D, R_Megabloc, R_Mol, R_Pattern, R_Polyhedron, R_Shape, R_SVG

public class R_Graphic extends BigBang
  • Constructor Details

    • R_Graphic

      public R_Graphic(processing.core.PApplet pa)
    • R_Graphic

      public R_Graphic(processing.core.PApplet pa, processing.core.PGraphics other)
  • Method Details

    • index_pixel_array

      public int index_pixel_array(int x, int y, int width)
      Overrides:
      index_pixel_array in class Rope
      Parameters:
      x - int coordinate of your targeting pixel
      y - int coordinate of your targeting pixel
      width - is the width of your image
      Returns:
      the rank of your pixel coordonate in the array pixel
    • renderer_P3D

      public boolean renderer_P3D()
      Returns:
      true if the graphic constext is is P3D, else return fase
    • renderer_P2D

      public boolean renderer_P2D()
    • get_renderer

      public String get_renderer()
      Overrides:
      get_renderer in class BigBang
      Returns:
      String of the the graphic contexts
    • get_renderer

      public String get_renderer(processing.core.PGraphics graph)
      Description copied from class: BigBang
      Return the current render in your processing Sketch
      Overrides:
      get_renderer in class BigBang
      Parameters:
      graph - pass the graphics context like P3D, P2D...
      Returns:
      return the String name of the graphic context
    • pass_graphic

      public void pass_graphic(processing.core.PGraphics other)
      Parameters:
      other - PGraphics rendering art work
    • createGraphics

      public processing.core.PGraphics createGraphics(float x, float y, String type)
    • colorMode

      public void colorMode(int mode, float max_x, float max_y, float max_z, float max_a)
      Parameters:
      mode - type color environment RGB or HSB
      max_x - float max value for X component
      max_y - float max value for Y component
      max_z - float max value for Z component
      max_a - float max value for alpha component
    • colorMode

      public void colorMode(int mode, vec3 arg)
    • colorMode

      public void colorMode(int mode, vec2 arg)
    • colorMode

      public void colorMode(int mode, vec4 arg)
    • colorMode

      public void colorMode(int mode)
    • colorMode

      public void colorMode(int mode, float max)
    • colorMode

      public void colorMode(int mode, float max_x, float max_y, float max_z)
    • shader

      public void shader(processing.opengl.PShader shader)
      SHADER
    • loadShader

      public processing.opengl.PShader loadShader(String path)
    • image

      public void image(processing.core.PImage img, vec pos)
    • image

      public void image(processing.core.PImage img, float a, float b)
    • image

      public void image(processing.core.PImage img, float a, float b, float c, float d)
    • image

      public void image(processing.core.PImage img, float a, float b, float c, float d, int u1, int v1, int u2, int v2)
    • get

      public int get(int x, int y)
    • set

      public void set(int x, int y, int c)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      x - position to set pixel
      y - position to set pixel
      c - int color pixel
    • set

      public void set(vec2 pos, int c)
      Parameters:
      pos - vec2 position to set pixel
      c - int color pixel
    • set

      public void set(ivec2 pos, int c)
      Parameters:
      pos - ivec2 position to set pixel
      c - int color pixel
    • point

      public void point(float x, float y)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      x - x-coordinate of the point
      y - y-coordinate of the point
    • point

      public void point(float x, float y, float z)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      x - x-coordinate of the point
      y - y-coordinate of the point
      z - z-coordinate of the point
    • point

      public void point(vec pos)
      Parameters:
      pos - x,y,z-coordinate of the point
    • point

      public void point(ivec pos)
      Parameters:
      pos - x,y,z-coordinate of the point
    • line

      public void line(float x1, float y1, float x2, float y2)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      x1 - x-coordinate of the first point
      y1 - y-coordinate of the first point
      x2 - x-coordinate of the second point
      y2 - y-coordinate of the second point
    • line

      public void line(float x1, float y1, float z1, float x2, float y2, float z2)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      z1 - z-coordinate of the first point
      z2 - z-coordinate of the second point
    • line

      public void line(vec a, vec b)
      Parameters:
      a - vec position of a point
      b - vec position of b point
    • line

      public void line(ivec a, ivec b)
      Parameters:
      a - ivec position of a point
      b - ivec position of b point
    • triangle

      public void triangle(ivec a, ivec b, ivec c)
      Parameters:
      a - ivec position of a summit
      b - ivec position of b summit
      c - ivec position of c summit
    • triangle

      public void triangle(vec a, vec b, vec c)
      Parameters:
      a - vec position of a summit
      b - vec position of b summit
      c - vec position of c summit
    • triangle

      public void triangle(float x1, float y1, float x2, float y2, float x3, float y3)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      x1 - x-coordinate of the first point
      y1 - y-coordinate of the first point
      x2 - x-coordinate of the second point
      y2 - y-coordinate of the second point
      x3 - x-coordinate of the third point
      y3 - y-coordinate of the third point
      See Also:
      • PApplet.beginShape()
    • rectMode

      public void rectMode(int mode)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      mode - either CORNER, CORNERS, CENTER, or RADIUS
    • rectMode

      public int rectMode()
    • arc

      public void arc(vec2 pos, vec2 size, float start, float stop)
    • arc

      public void arc(vec2 pos, vec2 size, float start, float stop, int mode)
    • arc

      public void arc(float px, float py, float sx, float sy, float start, float stop)
    • arc

      public void arc(float px, float py, float sx, float sy, float start, float stop, int mode)
    • ellipse

      public void ellipse(float px, float py, float sx, float sy)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      px - float value for the ellipse position
      py - float value for the ellipse position
      sx - float value for the ellipse size
      sy - float value for the ellipse size
    • ellipse

      public void ellipse(vec p, float x, float y)
    • ellipse

      public void ellipse(vec p, float x)
    • ellipse

      public void ellipse(vec p, vec s)
    • ellipseMode

      public void ellipseMode(int mode)
    • ellipseMode

      public int ellipseMode()
    • square

      public void square(float x, float y, float extent)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      x - x-coordinate of the rectangle by default
      y - y-coordinate of the rectangle by default
      extent - width and height of the rectangle by default
    • square

      public void square(vec pos, float extent)
      Parameters:
      pos - vec value for position, vec2 or vec3 is accepted for x,y and z coordinate
      extent - float value for side size of the rect / square
    • rect

      public void rect(float px, float py, float sx, float sy)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      px - float value for position
      py - float value for position
      sx - float value for size
      sy - float value for size
    • rect

      public void rect(float px, float py, float sx, float sy, float r)
    • rect

      public void rect(float px, float py, float sx, float sy, float tl, float tr, float br, float bl)
    • rect

      public void rect(vec p, vec s)
    • rect

      public void rect(vec p, vec s, float rounded)
    • rect

      public void rect(vec p, vec s, vec4 rounded)
    • box

      public void box(float x, float y, float z)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      x - float value for size
      y - float value for size
      z - float value for size
    • box

      public void box(float size)
    • box

      public void box(vec3 p)
    • sphere

      public void sphere(float radius)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      radius - float value for sphere radius
    • sphereDetail

      public void sphereDetail(int res)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      res - int value for details sphere rendering
    • sphereDetail

      public void sphereDetail(int ures, int vres)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      ures - int value for sphere details rendering
      vres - int value for sphere details rendering
    • fill

      public void fill(int rgb)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      rgb - in value for the stroke color
    • fill

      public void fill(int rgb, float alpha)
    • fill

      public void fill(float gray)
    • fill

      public void fill(float gray, float alpha)
    • fill

      public void fill(float x, float y, float z)
    • fill

      public void fill(float x, float y, float z, float a)
    • noFill

      public void noFill()
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
    • stroke

      public void stroke(int rgb)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work on it
      Parameters:
      rgb - in value for the stroke color
    • stroke

      public void stroke(int rgb, float alpha)
    • stroke

      public void stroke(float gray)
    • stroke

      public void stroke(float gray, float alpha)
    • stroke

      public void stroke(float x, float y, float z)
    • stroke

      public void stroke(float x, float y, float z, float a)
    • noStroke

      public void noStroke()
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
    • strokeWeight

      public void strokeWeight(float thickness)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      thickness - float value for the strokeWeight
    • thickness

      public void thickness(float thickness)
      This method is like strokeWeight of Processing
      Parameters:
      thickness - float value for the strokeWeight
    • aspect

      public void aspect(int fill, int stroke, float thickness)
    • aspect

      public void aspect(int fill, int stroke, float thickness, processing.core.PGraphics other)
      check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      fill - int value for color fill
      stroke - int value for color stroke
      thickness - float value for the strokeWeight
      other - is your PGRaphics to render your art work
    • push

      public void push()
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
    • pushMatrix

      public void pushMatrix()
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
    • pop

      public void pop()
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
    • popMatrix

      public void popMatrix()
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
    • translate

      public void translate(float x, float y, float z)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      x - float value to translate in x
      y - float value to translate in y
      z - float value to translate in z
    • translate

      public void translate(float x, float y)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      x - float value to translate in x
      y - float value to translate in y
    • translate

      public void translate(vec v)
      Parameters:
      v - vec value for translation in x,y or x,y, z
    • rotate

      public void rotate(float angle)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      angle - float value in radiant for rotation
    • rotateX

      public void rotateX(float angle)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      angle - float value in radiant for rotation
    • rotateY

      public void rotateY(float angle)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      angle - float value in radiant for rotation
    • rotateZ

      public void rotateZ(float angle)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      angle - float value in radiant for rotation
    • rotateXY

      public void rotateXY(vec2 rot)
      Parameters:
      rot - vec2 radiant value for the rotation
    • rotateXZ

      public void rotateXZ(vec2 rot)
      Parameters:
      rot - vec2 radiant value for the rotation
    • rotateYZ

      public void rotateYZ(vec2 rot)
      Parameters:
      rot - vec2 radiant value for the rotation
    • rotateXYZ

      public void rotateXYZ(vec3 rot)
      Parameters:
      rot - vec3 radiant value for the rotation
    • scale

      public void scale(float s)
      Increases or decreases the size of a shape by expanding and contracting vertices. Objects always scale from their relative origin to the coordinate system. Scale values are specified as decimal percentages. For example, the function call scale(2.0) increases the dimension of a shape by 200%. Transformations apply to everything that happens after and subsequent calls to the function multiply the effect. For example, calling scale(2.0) and then scale(1.5) is the same as scale(3.0). If scale() is called within draw(), the transformation is reset when the loop begins again. Using this function with the z parameter requires using P3D as a parameter for size(), as shown in the third example above. This function can be further controlled with pushMatrix( and popMatrix(.
      Parameters:
      s - float value to scale
    • scale

      public void scale(float x, float y)
      Not recommended for use in 3D, because the z-dimension is just scaled by 1, since there's no way to know what else to scale it by.
      Parameters:
      x - percentage to scale the object in the x-axis
      y - percentage to scale the object in the y-axis
    • scale

      public void scale(float x, float y, float z)
      Parameters:
      x - percentage to scale the object in the x-axis
      y - percentage to scale the object in the y-axis
      z - percentage to scale the object in the z-axis
    • shearX

      public void shearX(float angle)
      see Processing information
      Parameters:
      angle - float radiant value for shear
    • shearY

      public void shearY(float angle)
      see Processing information
      Parameters:
      angle - float radiant value for shear
    • beginContour

      public void beginContour()
      BEGIN_CONTOUR / END_CONTOUR
    • endContour

      public void endContour()
    • beginShape

      public void beginShape()
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
    • beginShape

      public void beginShape(int kind)
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
      Parameters:
      kind - type of rendering
    • endShape

      public void endShape()
      This Processing clone method, add check if any PGraphics is active, and if it's a case work ont it
    • endShape

      public void endShape(int mode)
      Parameters:
      mode - type of rendering
    • vertex

      public void vertex(float x, float y, processing.core.PGraphics other)
      Parameters:
      x - float value for coordinate
      y - float value for coordinate
      other - PGraphics rendering
    • vertex

      public void vertex(float x, float y, float z, processing.core.PGraphics other)
      Parameters:
      x - float value for coordinate
      y - float value for coordinate
      z - float value for coordinate
      other - PGraphics rendering
    • vertex

      public void vertex(float[] v, processing.core.PGraphics other)
      Parameters:
      v - array value for coordinate
      other - PGraphics rendering
    • vertex

      public void vertex(float x, float y, float u, float v, processing.core.PGraphics other)
      Parameters:
      x - float value for coordinate
      y - float value for coordinate
      u - float value for uv
      v - float value for uv
      other - PGraphics rendering
    • vertex

      public void vertex(float x, float y, float z, float u, float v, processing.core.PGraphics other)
      Parameters:
      x - float value for coordinate
      y - float value for coordinate
      z - float value for coordinate
      u - float value for uv
      v - float value for uv
      other - PGraphics rendering
    • vertex

      public void vertex(vec coord, processing.core.PGraphics other)
      Parameters:
      coord - vec position for the vertex
      other - PGraphics rendering
    • vertex

      public void vertex(vec2 coord, vec2 uv, processing.core.PGraphics other)
      Parameters:
      coord - vec2 position for the vertex
      uv - vec uv for the vertex
      other - PGraphics rendering
    • vertex

      public void vertex(vec3 coord, vec2 uv, processing.core.PGraphics other)
      Parameters:
      coord - vec3 position for the vertex
      uv - vec uv for the vertex
      other - PGraphics rendering
    • vertex

      public void vertex(vec v)
      Parameters:
      v - vec position for the vertex
    • vertex

      public void vertex(vec2 v, vec2 uv)
      Parameters:
      v -
      uv -
    • vertex

      public void vertex(vec3 v, vec2 uv)
      Parameters:
      v -
      uv -
    • vertex

      public void vertex(float x, float y)
      Parameters:
      x - x-coordinate of the vertex
      y - y-coordinate of the vertex
    • vertex

      public void vertex(float x, float y, float z)
      Parameters:
      x - x-coordinate of the vertex
      y - y-coordinate of the vertex
      z - z-coordinate of the vertex
    • vertex

      public void vertex(float[] v)
      Parameters:
      v - array value for coordinate
    • vertex

      public void vertex(float x, float y, float u, float v)
      Parameters:
      x - float value for coordinate
      y - float value for coordinate
      u - float value for uv
      v - float value for uv
    • vertex

      public void vertex(float x, float y, float z, float u, float v)
      Parameters:
      x - float value for coordinate
      y - float value for coordinate
      z - float value for coordinate
      u - float value for uv
      v - float value for uv
    • bezierVertex

      public void bezierVertex(float x2, float y2, float x3, float y3, float x4, float y4, processing.core.PGraphics other)
      BEZIER VERTEX
    • bezierVertex

      public void bezierVertex(float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, processing.core.PGraphics other)
    • bezierVertex

      public void bezierVertex(vec a, vec b, vec pos, processing.core.PGraphics other)
    • bezierVertex

      public void bezierVertex(vec a, vec b, vec pos)
    • bezierVertex

      public void bezierVertex(float x2, float y2, float x3, float y3, float x4, float y4)
      Parameters:
      x2 - the x-coordinate of the 1st control point
      y2 - the y-coordinate of the 1st control point
      x3 - the x-coordinate of the 2nd control point
      y3 - the y-coordinate of the 2nd control point
      x4 - the x-coordinate of the anchor point
      y4 - the y-coordinate of the anchor point
    • bezierVertex

      public void bezierVertex(float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4)
      Parameters:
      x2 - the x-coordinate of the 1st control point
      y2 - the y-coordinate of the 1st control point
      z2 - the z-coordinate of the 1st control point
      x3 - the x-coordinate of the 2nd control point
      y3 - the y-coordinate of the 2nd control point
      z3 - the z-coordinate of the 2nd control point
      x4 - the x-coordinate of the anchor point
      y4 - the y-coordinate of the anchor point
      z4 - the z-coordinate of the anchor point
    • quadraticVertex

      public void quadraticVertex(float cx, float cy, float x3, float y3, processing.core.PGraphics other)
      QUADRATIC VERTEX
    • quadraticVertex

      public void quadraticVertex(float cx, float cy, float cz, float x3, float y3, float z3, processing.core.PGraphics other)
    • quadraticVertex

      public void quadraticVertex(vec a, vec b, processing.core.PGraphics other)
    • quadraticVertex

      public void quadraticVertex(vec a, vec b)
    • quadraticVertex

      public void quadraticVertex(float cx, float cy, float x3, float y3)
      Parameters:
      cx - the x-coordinate of the control point
      cy - the y-coordinate of the control point
      x3 - the x-coordinate of the anchor point
      y3 - the y-coordinate of the anchor point
    • quadraticVertex

      public void quadraticVertex(float cx, float cy, float cz, float x3, float y3, float z3)
      Parameters:
      cx - the x-coordinate of the control point
      cy - the y-coordinate of the control point
      cz - the z-coordinate of the control point
      x3 - the x-coordinate of the anchor point
      y3 - the y-coordinate of the anchor point
      z3 - the z-coordinate of the anchor point
    • curveVertex

      public void curveVertex(float x, float y, float z, processing.core.PGraphics other)
      Parameters:
      x -
      y -
      z -
      other -
    • curveVertex

      public void curveVertex(float x, float y, processing.core.PGraphics other)
    • curveVertex

      public void curveVertex(vec pos, processing.core.PGraphics other)
    • curveVertex

      public void curveVertex(vec pos)
    • curveVertex

      public void curveVertex(float x, float y)
      Parameters:
      x - the x-coordinate of the vertex
      y - the y-coordinate of the vertex
    • curveVertex

      public void curveVertex(float x, float y, float z)
      Parameters:
      x - the x-coordinate of the vertex
      y - the y-coordinate of the vertex
      z - the z-coordinate of the vertex
    • textAlign

      public void textAlign(int alignX)
      TEXT
    • textAlign

      public void textAlign(int alignX, int alignY)
      Parameters:
      alignX - horizontal alignment, either LEFT, CENTER, or RIGHT
      alignY - vertical alignment, either TOP, BOTTOM, CENTER, or BASELINE
    • textFont

      public void textFont(processing.core.PFont which)
    • textFont

      public void textFont(processing.core.PFont which, float size)
      Parameters:
      size - the size of the letters in units of pixels
    • textSize

      public void textSize(float size)
    • text

      public void text(char c, float x, float y)
    • text

      public void text(char c, float x, float y, float z)
    • text

      public void text(String str, float x, float y)
    • text

      public void text(char[] chars, int start, int stop, float x, float y)
    • text

      public void text(String str, float x, float y, float z)
      Same as above but with a z coordinate.
    • text

      public void text(char[] chars, int start, int stop, float x, float y, float z)
    • text

      public void text(String str, float x1, float y1, float x2, float y2)
    • text

      public void text(int i_num, float x, float y)
    • text

      public void text(int i_num, float x, float y, float z)
    • text

      public void text(float f_num, float x, float y)
    • text

      public void text(float f_num, float x, float y, float z)
    • text

      public void text(String s, vec2 pos, vec2 size)
    • text

      public void text(String s, vec pos)
    • text

      public void text(char c, vec pos)
    • text

      public void text(int i, vec pos)
    • text

      public void text(float f, vec pos)