CodingTrain / CodingTrain/Suggestion-Box

3D mapping

Open
#993 9 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Im working on a project and i have an issue, i dont know if its possible to do in processing. I've made a Globe and i want to map different points on it. I dont know if im explaining myself, but basically i want to put different points on my globe indicating specific data like for example population, this point must be different in size and colour depending on how large the population is linking it to the data document.

This is what i have so far, but i dont know how to map on a sphere. Thanks in advance.

```
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("Tierra.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;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.