# 3D interactivity

**URL:** https://discourse.processing.org/t/3d-interactivity/639
**Category:** Processing
**Created:** [June 2, 2018, 2:44pm UTC](https://discourse.processing.org/t/3d-interactivity/639 "2018-06-02T14:44:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Cuchis](https://avatars.discourse-cdn.com/v4/letter/c/e0b2c6/32.png) [@Cuchis](https://discourse.processing.org/u/Cuchis)
#### Post date: [June 2, 2018, 2:44pm UTC](https://discourse.processing.org/t/3d-interactivity/639/1 "2018-06-02T14:44:16Z")

</div>

Im working on a project with processing, im struggling in programing a globe to be interactive. I want to click on a country and make it give me information about it. For example, if i click on Spain (on the 3D globe) i want to see the population.

Here’s what i have so far, if someone can help me i would really appreaciate it. Thanks in advance!

```auto
float rotx = PI/4;
float roty = PI/4;
float rotz = PI/4;
PShape tierra;
PImage texturaTierra;

int x = 0;
int y = 0;
int z = 0;

void setup() {
size(800,600,P3D);

noStroke();
fill(255);
sphereDetail(200);

texturaTierra = loadImage(“Tierra2.jpg”);
tierra = createShape(SPHERE,150);
tierra.setTexture(texturaTierra);

}
void draw() {

background(0);
lights();

pushMatrix(); //esfera
translate(width/2,height/2);
rotateX(rotx);
rotateY(roty);
shape(tierra);
popMatrix();

}

void mouseDragged() {
float rate = 0.005; //velocidad de rotacion
rotx += (pmouseY-mouseY) * rate;
roty += (mouseX-pmouseX) * rate;
}

```

---

<div class="post-metadata">

### Author: ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)
#### Post date: [June 4, 2018, 6:06am UTC](https://discourse.processing.org/t/3d-interactivity/639/2 "2018-06-04T06:06:26Z")

</div>

I believe the proscene library can help you achieve this, check it out. See PointUnderPixel example, but I guess there is a shed load more work to add information to pixels. I,m pretty sure toxiclibs and some other libraries have a way of mapping geo-positions (and hence adding labels).
