Skip to content

Commit 11e726d

Browse files
committed
updated AR examples
1 parent a4a9e55 commit 11e726d

File tree

10 files changed

+55
-47
lines changed

10 files changed

+55
-47
lines changed
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import processing.ar.*;
2-
import processing.ar.render.*;
2+
33
PShape cube;
4-
public void setup() {
5-
fullScreen(AR);
6-
cube = createShape(BOX, 0.25f);
4+
5+
void setup() {
6+
fullScreen(ARCORE);
7+
cube = createShape(BOX, 0.25);
8+
ARPlane.setPlaneColor(#BCD4FF);
79
}
8-
public void draw() {
9-
lights();
10-
background(0);
11-
PPlane.setPlaneColor(0x00BCD4FF);
12-
shape(cube);
10+
11+
void draw() {
12+
lights();
13+
background(0);
14+
shape(cube);
1315
}

mode/libraries/ar/examples/Cube/sketch.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
import processing.ar.*;
2-
import processing.ar.render.*;
3-
PObject arObj;
4-
public void setup() {
5-
fullScreen(AR);
6-
//Initialisation of AR Object
7-
arObj = new PObject();
8-
//Setting Color of the detected plane - BLUE in this case
9-
PPlane.setPlaneColor(0x00BCD4FF);
10-
//Applying custom textures to the detected plane
11-
PPlane.setPlaneTexture("triangle.png");
12-
//Loading .obj file of the AR object
13-
arObj.load("model.obj","grey.png");
2+
3+
PShape arObj;
4+
5+
void setup() {
6+
fullScreen(ARCORE);
7+
8+
// Setting Color of the detected plane - BLUE in this case
9+
ARPlane.setPlaneColor(#BCD4FF);
10+
11+
arObj = loadShape("model.obj");
1412
}
15-
public void draw() {
16-
lights();
17-
background(0);
18-
if(mousePressed){
19-
//Placing the AR object on encountering touch events
20-
arObj.place();
21-
}
13+
14+
void draw() {
15+
lights();
16+
background(0);
17+
if (mousePressed) {
18+
// Placing the AR object on encountering touch events
19+
shape(arObj);
20+
}
2221
}
Binary file not shown.

mode/libraries/ar/examples/ImportObj/sketch.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.

mode/libraries/ar/examples/Sphere/Sphere.pde

Lines changed: 0 additions & 13 deletions
This file was deleted.

mode/libraries/ar/examples/Sphere/sketch.properties

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import processing.ar.*;
2+
3+
float angle = 0;
4+
5+
void setup() {
6+
fullScreen(ARCORE);
7+
ARPlane.setPlaneColor(0xB4E7FF);
8+
}
9+
10+
void draw() {
11+
// At this point, there is no much AR-specific API, but you can get the AR Core session, frame,
12+
// and camera to extract more information about the AR scene.
13+
// PSurfaceAR surface = (PSurfaceAR) getSurface();
14+
// surface.camera.getPose();
15+
// surface.frame.getLightEstimate();
16+
17+
background(0);
18+
lights();
19+
fill(0xFCB736);
20+
noStroke();
21+
sphere(0.10);
22+
rotateZ(angle);
23+
translate(0, 0.3,0);
24+
sphere(0.05);
25+
angle += 0.1;
26+
}

0 commit comments

Comments
 (0)