Created
May 6, 2014 20:08
-
-
Save tado/455a2be1b966e3c594d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Markdownのテスト | |
* マークダウンだよー | |
* ほげほげ | |
* らくちんだ | |
--- | |
> 引用だって書けちゃいます。ぽよよ。あいうえおー。 | |
--- | |
## ATOMがオープンソースへ | |
ATOMどんなもんでしょ? まだまだこれから? | |
--- | |
### 表 | |
| Tables | Are | Cool | | |
| ------------- |:-------------:| -----:| | |
| col 3 is | right-aligned | $1600 | | |
| col 2 is | centered | $12 | | |
| zebra stripes | are neat | $1 | | |
--- | |
```javascript | |
float gx, gy, gz; | |
int time; | |
void setup() { | |
size(640, 480, P3D); | |
JSONObject json = loadJSONObject("http://api.artsat.jp/invader/sensor_data.json"); | |
JSONArray results = json.getJSONArray("results"); | |
JSONObject sensors = results.getJSONObject(0).getJSONObject("sensors"); | |
gx = sensors.getFloat("gx"); | |
gy = sensors.getFloat("gy"); | |
gz = sensors.getFloat("gz"); | |
time = results.getJSONObject(0).getInt("time"); | |
rectMode(CENTER); | |
println(time + ", " + gx + ", " + gy + ", " + gz); | |
} | |
void draw() { | |
background(0); | |
translate(width/2, height/2); | |
rotateX(radians(gx) * millis() / 1000.0); | |
rotateY(radians(gy) * millis() / 1000.0); | |
rotateZ(radians(gz) * millis() / 1000.0); | |
box(100); | |
} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment