Search in sources :

Example 11 with PVector

use of processing.core.PVector in project processing by processing.

the class PShapeOpenGL method getDepth.

@Override
public float getDepth() {
    PVector min = new PVector(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
    PVector max = new PVector(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY);
    if (shapeCreated) {
        getVertexMin(min);
        getVertexMax(max);
    }
    depth = max.z - min.z;
    return depth;
}
Also used : PVector(processing.core.PVector)

Example 12 with PVector

use of processing.core.PVector in project processing by processing.

the class PShapeOpenGL method getNormal.

@Override
public PVector getNormal(int index, PVector vec) {
    if (vec == null) {
        vec = new PVector();
    }
    vec.x = inGeo.normals[3 * index + 0];
    vec.y = inGeo.normals[3 * index + 1];
    vec.z = inGeo.normals[3 * index + 2];
    return vec;
}
Also used : PVector(processing.core.PVector)

Example 13 with PVector

use of processing.core.PVector in project processing by processing.

the class PShapeOpenGL method getVertex.

@Override
public PVector getVertex(int index, PVector vec) {
    if (vec == null) {
        vec = new PVector();
    }
    vec.x = inGeo.vertices[3 * index + 0];
    vec.y = inGeo.vertices[3 * index + 1];
    vec.z = inGeo.vertices[3 * index + 2];
    return vec;
}
Also used : PVector(processing.core.PVector)

Aggregations

PVector (processing.core.PVector)13 Random (java.util.Random)3 Rectangle2D (java.awt.geom.Rectangle2D)2 Shape (java.awt.Shape)1 PFont (processing.core.PFont)1