Skip to content

Instantly share code, notes, and snippets.

View tatsuro-ueda's full-sized avatar

Tatsuro Ueda tatsuro-ueda

View GitHub Profile
@tatsuro-ueda
tatsuro-ueda / 1.js
Created February 8, 2012 02:00
120208-Google Mapで複数のマーカーの情報ウィンドウを切り替える(1つだけ表示する)2
var op = {
zoom: 17,
center: new google.maps.LatLng(35.7078118, 139.5773074),
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), op);
@tatsuro-ueda
tatsuro-ueda / 120208-GoogleMapMarkerTest2.js
Created February 7, 2012 18:33
120208-Google Mapで複数のマーカーの情報ウィンドウを切り替える(1つだけ表示する)
function initialize() {
var marker = new Array;
var info = new Array;
var json =
{ "spots": [
{ "lat": "35.708104", "lng": "139.577644", "category_id": "189", "id": "464704", "category": "レンタカー", "distance": "44", "name": "トヨタレンタリース東京 吉祥寺" },
{ "lat": "35.707729", "lng": "139.577865", "category_id": "83", "id": "698546", "category": "警察・交番", "distance": "51", "name": "武蔵野警察署八幡西宮交番" },
{ "lat": "35.707023471361", "lng": "139.578433703041", "category_id": "166", "id": "486294", "category": "雑貨屋", "distance": "134", "name": "Cut Bound" },
{ "lat": "35.707619", "lng": "139.579336", "category_id": "21", "id": "215488", "category": "スーパー", "distance": "184", "name": "マルエツ プチ 吉祥寺店" },
@tatsuro-ueda
tatsuro-ueda / 1.js
Created February 7, 2012 17:34
Google Mapで複数のマーカーの情報ウィンドウを切り替える
var op={
zoom:15,
center:new google.maps.LatLng(35.7078118,139.5773074),
mapTypeId:google.maps.MapTypeId.ROADMAP
};
var map=new google.maps.Map(document.getElementById("map_canvas"),op);
@tatsuro-ueda
tatsuro-ueda / AlphaMask.pde
Created February 6, 2012 00:42
Processing Examples Basic Image
// 「mask」として半透明な画像を使う。
// 2つの画像はPImageのmask()メソッドで合成される。
PImage img;
PImage maskImg;
void setup() {
size(200, 200);
img = loadImage("test.jpg");
maskImg = loadImage("mask.jpg");
@tatsuro-ueda
tatsuro-ueda / LoadImage.pde
Created February 5, 2012 22:46
Processing Examples Basic Web
size(200, 200);
PImage img1;
img1 = loadImage("http://processing.org/img/processing_cover.gif");
if (img1 != null) {
image(img1, 0, 0);
}
@tatsuro-ueda
tatsuro-ueda / Color.pde
Created February 5, 2012 08:25
Processing Examples Basic Color
// カーソルの位置が高いほど暗い色になる
int barWidth = 5;
int lastBar = -1;
void setup() {
size(200, 200);
colorMode(HSB, 360, 100, height);
noStroke();
background(0);
@tatsuro-ueda
tatsuro-ueda / Array.pde
Created February 5, 2012 07:27
Processing Examples Basic Arrays
// 「coswav」という配列をつくりコサイン値を入れる
size(200, 200);
float[] coswave = new float[width];
for (int i = 0; i < width; i++) {
// 0~widthを0~πに置き換える
float amount = map(i, 0, width, 0, PI);
// 絶対値(1~0~1)を配列に入れる
@tatsuro-ueda
tatsuro-ueda / draw.pde
Created February 2, 2012 10:31
KinectとProcessingでクロマキー
void draw()
{
// カメラ情報を更新する
context.update();
// sceneImageの人の部分を取り出すマスク用画像を作る
PImage maskImg = makeImgForMask(context.sceneImage());
PImage maskedImg = context.rgbImage(); // RGBカメラの映像がマスク対象
maskedImg.mask(maskImg); // 人物の形で繰り抜いて
@tatsuro-ueda
tatsuro-ueda / color-watagashi-prototype3.pde
Created February 2, 2012 06:12
color-watagashi-prototype3.pde
import SimpleOpenNI.*;
SimpleOpenNI context;
void setup()
{
context = new SimpleOpenNI(this);
// 深度カメラを有効にする
if(context.enableDepth() == false)
{
@tatsuro-ueda
tatsuro-ueda / color-watagashi-prototype2.pde
Created February 2, 2012 03:50
color-watagashi-prototype2.pde
import SimpleOpenNI.*;
SimpleOpenNI context;
void setup()
{
context = new SimpleOpenNI(this);
if(context.enableDepth() == false)
{
println("Can't open the depthMap, maybe the camera is not connected!");