-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproj3D.pde
More file actions
59 lines (44 loc) · 1.13 KB
/
proj3D.pde
File metadata and controls
59 lines (44 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
WarpSurface surface;
/*
final LatLon[] ROI = new LatLon[] {
new LatLon(42.505085,1.509961),
new LatLon(42.517067,1.544024),
new LatLon(42.508160,1.549798),
new LatLon(42.496162,1.515728)
};
*/
WarpCanvas canvas;
final LatLon[] bounds = new LatLon[] {
new LatLon(42.5181, 1.50803),
new LatLon(42.495, 1.50803),
new LatLon(42.495, 1.55216),
new LatLon(42.5181, 1.55216)
};
void setup() {
size(900, 700, P2D);
canvas = new WarpCanvas(this, "orto_epsg3857.jpg", bounds);
//surface = new WarpSurface(this, 700, 300, 6, 3, ROI);
surface = new WarpSurface(this, "surface.xml");
}
void draw() {
background(0);
surface.draw(canvas);
}
void mousePressed() {
LatLon loc = surface.unmapPoint(mouseX, mouseY);
println(loc);
if(loc != null) {
PVector pos = canvas.toScreen(loc.getLat(), loc.getLon());
canvas.beginDraw();
canvas.fill(#FF0000);
canvas.ellipse(pos.x, pos.y, 10, 10);
canvas.endDraw();
}
}
void keyPressed() {
switch(key) {
case 'w':
surface.toggleCalibration();
break;
}
}