嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 10 元微信扫码支付:10 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
用processing进行可视化数据
void draw(){
background(51);
//image(earth,0,0);
translate(width*0.5,height*0.5);
rotateY(angle);
angle =0.03;
lights();
fill(200);
//sphere(r);
shape(globe);
for (TableRow row:table.rows()){
float lat=row.getFloat("latitude");
float lon=row.getFloat("longitude");
float mag=row.getFloat("mag");
float theta=radians(lat) PI/2;
float phi=radians(lon) PI;
float x=r*sin(theta)*cos(phi);
float y=-r*sin(theta)*sin(phi);
float z=r*cos(theta);
PVector pos=new PVector(x,y,z);
float h=pow(10,mag);
float maxh=pow(10,7);
h=map(h,0,maxh,10,100);
PVector xaxis=new PVector(1,0,0);
float angleb=PVector.angleBetween(xaxis,pos);
PVector raxis=xaxis.cross(pos);
pushMatrix();
translate(x,y,z);
rotate(angleb,raxis.x,raxis.y,raxis.z);
fill(225);
box(h,5,5);
popMatrix();
}
}