def setup
createCanvas(100, 100, WEBGL)
@cam = createCamera
@divx = createDiv
@divy = createDiv
@divz = createDiv
end
def draw
background(220)
orbitControl
box(30)
@divx.html("upX = #{round(@cam.upX, 1)}")
@divy.html("upY = #{round(@cam.upY, 1)}")
@divz.html("upZ = #{round(@cam.upZ, 1)}")
end
def setup
createCanvas(100, 100, WEBGL)
@cam = createCamera
@cam.camera(100, -400, 800, 0, 0, 0, 0, 1, 0)
@div = createDiv.position(10, 105)
@tex = createGraphics(50, 50).background(255)
.textSize(30)
.text("A", 15, 35)
end
def draw
background(200)
fill(255)
texture(@tex)
box
y = sin(frameCount * 0.01)
@cam.camera(100, -400, 800, 0, 0, 0, 0, y, 0)
@div.html("upY: #{round(@cam.upY, 1)}")
end
カメラの上向き方向をあらわすベクトルの y軸成分
・値の参照のみ可能です。