From 3916282fc61cb1143dfc33d79dfc3169293b0969 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 31 Mar 2015 17:30:53 -0400 Subject: rightclick to recenter --- public/assets/test/ortho2.html | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'public/assets/test/ortho2.html') diff --git a/public/assets/test/ortho2.html b/public/assets/test/ortho2.html index d6f0c5c..2c600f5 100644 --- a/public/assets/test/ortho2.html +++ b/public/assets/test/ortho2.html @@ -50,6 +50,7 @@ body { + @@ -298,7 +299,16 @@ function build () { rotationY: PI, }) scene.add(floorplan) - + floorplan.el.addEventListener("contextmenu", function(e){ + e.preventDefault() + var offset = offsetFromPoint(e, this) + var x = (offset.left - 0.5) * floorplan.width + var z = (offset.top - 0.5) * floorplan.height + controls.opt.center.x = -x + controls.opt.center.y = 0 + controls.opt.center.z = -z + }, true) + scene.update() controls = new MX.OrbitCamera({ -- cgit v1.2.3-70-g09d2