Can any reproduce this result? For some reason I’m getting a negative dot product from what are basically the same vectors:
vector1: {x:-6.123233902474582e-17,y:-0.9999999847691294,z:0.0001745329224753608}
vector2: {x:-2.8327694394977715e-16,y:-0.9999999847691294,z:0.0001745329224753608}
Here are 2 code snippets to inject into camera.js and Camera Tutorial.js. These 2 vectors should be the result.
//start test code
//place this in camera.js right after: Cartesian3.cross(this.direction, this.up, this.right);
var temp1 = Matrix3.getColumn(Matrix4.getRotation(localTransform,new Matrix3),1,new Cartesian3);
var temp2 = this.direction;
console.log(" dot temp1 temp2 ",Cartesian3.dot(temp1,temp2));
console.log(" temp1 ",temp1);
console.log(" temp2 ",temp2);
console.log(" test1 ",Cartesian3.dot({x:-6.123233902474582e-17,y:-0.9999999847691294,z:0.0001745329224753608},
{x:-2.8327694394977715e-16,y:-0.9999999847691294,z:0.0001745329224753608}));
console.log(" test2 ",-6.123233902474582e-17*-2.8327694394977715e-16±0.9999999847691294*-0.9999999847691294+0.0001745329224753608*0.0001745329224753608);
//end test code
``
//start test code
//place this in Camera Tutorial right before: viewer.clock.onTick.addEventListener(function(clock) {
//http://localhost:8080/Apps/Sandcastle/gallery/Camera%20Tutorial.html
var position = new Cesium.Cartographic(Cesium.Math.toRadians(90.0), Cesium.Math.toRadians(89.99), 10);
var cartesianPosition = Cesium.Ellipsoid.WGS84.cartographicToCartesian(position);
viewer.camera.position=cartesianPosition;
viewer.camera.setView({
heading : Cesium.Math.toRadians(0.0),
pitch : Cesium.Math.toRadians(0.0),
roll : Cesium.Math.toRadians(0.0)
});
//end test code
``