|
From: <ma...@us...> - 2011-12-09 15:37:13
|
Revision: 558
http://openautomation.svn.sourceforge.net/openautomation/?rev=558&view=rev
Author: mayerch
Date: 2011-12-09 15:37:02 +0000 (Fri, 09 Dec 2011)
Log Message:
-----------
Corrected up vector calculation for the camera setup so that it's not jumping anymore at the extreme case
Modified Paths:
--------------
JSFloorPlan/trunk/jsfloorplan.js
Modified: JSFloorPlan/trunk/jsfloorplan.js
===================================================================
--- JSFloorPlan/trunk/jsfloorplan.js 2011-12-09 12:49:24 UTC (rev 557)
+++ JSFloorPlan/trunk/jsfloorplan.js 2011-12-09 15:37:02 UTC (rev 558)
@@ -893,7 +893,7 @@
var cx = -Math.cos(rotation) * Math.cos(tilt);
var cy = Math.sin(rotation) * Math.cos(tilt);
var cz = Math.sin(tilt);
- camera.up = new THREE.Vector3( -cx, -cy, 1 );
+ camera.up = new THREE.Vector3( Math.cos(rotation) * Math.sin(tilt), -Math.sin(rotation) * Math.sin(tilt), Math.cos(tilt) );
camera.position = new THREE.Vector3( cx*dist + buildingProperties.x_center, cy*dist + buildingProperties.y_center, dist * cz );
camera.lookAt( new THREE.Vector3( buildingProperties.x_center, buildingProperties.y_center, 0) );
pointLight.position = camera.position;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|