Bullseye #
Bullseye is an 2D object that helps identify a 3D point’s position. Useful to identify if an object is moving.
Params #
Name | PropType | description |
---|---|---|
x | number | Position in x. |
y | number | Position in y. |
size | number | Bullseye’s diameter. |
shape | number | Bullseye can be circular (using Tree.CIRCLE ) or squared (using Tree.SQUARE ). default is circular. |
Showcase #
code #
sketch.js
// gui params
var x = 300;
var y = 150;
var size = 100;
var shape = ['Tree.CIRCLE', 'Tree.SQUARE'];
var selectedShape;
var gui;
function setup() {
createCanvas(400, 400, WEBGL);
gui = createGui('Double click to close');
gui.addGlobals('x', 'y', 'size', 'shape');
y = 150;
noLoop();
}
function draw() {
// pick a shape
switch (shape) {
case 'Tree.SQUARE':
selectedShape = Tree.SQUARE;
break;
default:
selectedShape = Tree.CIRCLE;
break;
}
background(255);
stroke(0, 255, 255);
strokeWeight(4);
push();
bullsEye({ x, y, size, shape: selectedShape });
pop();
}