fix #775, zoom in while start dragging with earth controls

This commit is contained in:
m-schuetz 2020-05-11 17:18:07 +02:00
parent 1ba46afc60
commit d8abe2721f
4 changed files with 4 additions and 24 deletions

View File

@ -1,21 +1,2 @@
Thank you for your interest! In an effort to make it easier to respond to your problem we would like
for you to consider a few things:
- Can you try to phrase it as a task?
Instead of "What unit is used in the cut view?" ask for "Clarify unit in cut view".
- Can you make a screenshot or a screencast?
Some graphic errors are hard to describe, a screenshot helps to get your problem accross.
A service like [Gyazo Gif](https://gyazo.com/download) makes it possible to keep the link up for a long time.
Please don't link to a url that could be gone in a month or two (like dropbox).
- Did you reach out on Gitter?
We have a gitter [channel for potree](https://gitter.im/potree/Lobby). Did you try to ask about your issue there?
- Is all information accessible for us?
A cryptic error message like "Doesn't work on my computer" will not help us much. It would be awesome if
you could provide a permalink or code sample to the problematic section. What OS, potree and browser version you are
you using? How can we reproduce the issue? Logs can help too and
[Gists](https://help.github.com/articles/creating-gists/) are a good idea as well.
Thank you for your consideration, please delete this text after you read it.
If you're reporting an error, please try to provide detailed error messages and, if possible, instructions on how to replicate the issue.

View File

@ -57,7 +57,6 @@
viewer.toggleSidebar();
});
// Sigeom
Potree.loadPointCloud("http://5.9.65.151/mschuetz/potree/resources/pointclouds/opentopography/CA13_1.4/cloud.js", "CA13", function(e){
viewer.scene.addPointCloud(e.pointcloud);
e.pointcloud.position.z = 0;

View File

@ -47,6 +47,7 @@ export class EarthControls extends EventDispatcher {
}
let camStart = this.camStart;
let camera = this.scene.getActiveCamera();
let view = this.viewer.scene.view;
// let camera = this.viewer.scene.camera;
@ -55,7 +56,7 @@ export class EarthControls extends EventDispatcher {
if (e.drag.mouse === MOUSE.LEFT) {
let ray = Utils.mouseToRay(mouse, camStart, domElement.clientWidth, domElement.clientHeight);
let ray = Utils.mouseToRay(mouse, camera, domElement.clientWidth, domElement.clientHeight);
let plane = new THREE.Plane().setFromNormalAndCoplanarPoint(
new THREE.Vector3(0, 0, 1),
this.pivot);

View File

@ -527,9 +527,8 @@ export class Utils {
};
let vector = new THREE.Vector3(normalizedMouse.x, normalizedMouse.y, 0.5);
let origin = new THREE.Vector3(normalizedMouse.x, normalizedMouse.y, 0);
let origin = camera.position.clone();
vector.unproject(camera);
origin.unproject(camera);
let direction = new THREE.Vector3().subVectors(vector, origin).normalize();
let ray = new THREE.Ray(origin, direction);