Switch to threejs with double precision; refactor for maintanance
This commit is contained in:
parent
60e05234c8
commit
dca2ee55e8
@ -15,11 +15,11 @@
|
||||
|
||||
<body>
|
||||
|
||||
<script src="../libs/jquery/jquery-3.1.1.min.js"></script>
|
||||
<script src="../libs/jquery/jquery-3.1.1.js"></script>
|
||||
|
||||
<!--<script src="../libs/other/webgl-debug.js"></script>-->
|
||||
<script src="../libs/perfect-scrollbar/js/perfect-scrollbar.jquery.js"></script>
|
||||
<script src="../libs/jquery-ui-1.11.4/jquery-ui.min.js"></script>
|
||||
<script src="../libs/jquery-ui/jquery-ui.min.js"></script>
|
||||
<script src="../libs/three.js/build/three.js"></script>
|
||||
<script src="../libs/other/stats.min.js"></script>
|
||||
<script src="../libs/other/BinaryHeap.js"></script>
|
||||
@ -116,7 +116,9 @@
|
||||
|
||||
viewer.setDescription("");
|
||||
|
||||
viewer.addPointCloud("../pointclouds/vol_total/cloud.js");
|
||||
viewer.addPointCloud("../pointclouds/vol_total/cloud.js", function(e){
|
||||
viewer.camera.position.set(589789.45, 761.83, -231420.51);
|
||||
});
|
||||
//viewer.addPointCloud("../pointclouds/lion_takanawa/cloud.js", function(e){
|
||||
// viewer.camera.position.set(3.65, 5.78, 4.97);
|
||||
// e.pointcloud.setName("Lion");
|
||||
|
||||
10220
libs/jquery/jquery-3.1.1.js
vendored
Normal file
10220
libs/jquery/jquery-3.1.1.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
42297
libs/three.js/build/three - Copy.js
Normal file
42297
libs/three.js/build/three - Copy.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -254,8 +254,14 @@ Potree.OrbitControls = function ( object, domElement ) {
|
||||
|
||||
var progression = Math.min(1, this.fadeFactor * delta);
|
||||
|
||||
let oldTheta = theta;
|
||||
|
||||
theta += progression * thetaDelta;
|
||||
phi += progression * phiDelta;
|
||||
|
||||
if(oldTheta !== theta){
|
||||
console.log(theta);
|
||||
}
|
||||
|
||||
// restrict phi to be between desired limits
|
||||
phi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) );
|
||||
|
||||
@ -31,7 +31,6 @@ varying float vLinearDepth;
|
||||
varying float vLogDepth;
|
||||
varying vec3 vViewPosition;
|
||||
varying float vRadius;
|
||||
varying vec3 vWorldPosition;
|
||||
varying vec3 vNormal;
|
||||
|
||||
float specularStrength = 1.0;
|
||||
@ -204,7 +203,7 @@ void main() {
|
||||
|
||||
#if defined use_interpolation
|
||||
float wi = 0.0 - ( u*u + v*v);
|
||||
vec4 pos = vec4(-vViewPosition, 1.0);
|
||||
vec4 pos = vec4(vViewPosition, 1.0);
|
||||
pos.z += wi * vRadius;
|
||||
float linearDepth = -pos.z;
|
||||
pos = projectionMatrix * pos;
|
||||
|
||||
@ -315,10 +315,8 @@ vec3 getCompositeColor(){
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 worldPosition = modelMatrix * vec4( position, 1.0 );
|
||||
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
|
||||
vViewPosition = -mvPosition.xyz;
|
||||
vWorldPosition = worldPosition.xyz;
|
||||
vViewPosition = mvPosition.xyz;
|
||||
gl_Position = projectionMatrix * mvPosition;
|
||||
vOpacity = opacity;
|
||||
vLinearDepth = gl_Position.w;
|
||||
@ -383,7 +381,7 @@ void main() {
|
||||
float pointSize = 1.0;
|
||||
|
||||
float slope = tan(fov / 2.0);
|
||||
float projFactor = 0.5 * screenHeight / (slope * vViewPosition.z);
|
||||
float projFactor = -0.5 * screenHeight / (slope * vViewPosition.z);
|
||||
|
||||
float r = spacing * 1.5;
|
||||
vRadius = r;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// http://epsg.io/
|
||||
proj4.defs("UTM10N", "+proj=utm +zone=10 +ellps=GRS80 +datum=NAD83 +units=m +no_defs");
|
||||
|
||||
Potree.Viewer.MapView = function(viewer){
|
||||
Potree.MapView = function(viewer){
|
||||
var scope = this;
|
||||
|
||||
this.viewer = viewer;
|
||||
@ -275,11 +275,11 @@ Potree.Viewer.MapView = function(viewer){
|
||||
|
||||
|
||||
// adding pointclouds to map
|
||||
scope.viewer.addEventListener("pointcloud_loaded", function(event){
|
||||
scope.viewer.dispatcher.addEventListener("pointcloud_loaded", function(event){
|
||||
scope.load(event.pointcloud);
|
||||
});
|
||||
for(var i = 0; i < scope.viewer.pointclouds.length; i++){
|
||||
scope.load(scope.viewer.pointclouds[i]);
|
||||
for(var i = 0; i < scope.viewer.scene.pointclouds.length; i++){
|
||||
scope.load(scope.viewer.scene.pointclouds[i]);
|
||||
}
|
||||
|
||||
scope.viewer.profileTool.addEventListener("profile_added", scope.updateToolDrawings);
|
||||
|
||||
@ -1305,8 +1305,8 @@ function initSceneList(){
|
||||
})(pointcloud);
|
||||
};
|
||||
|
||||
for(var i = 0; i < viewer.pointclouds.length; i++){
|
||||
var pointcloud = viewer.pointclouds[i];
|
||||
for(var i = 0; i < viewer.scene.pointclouds.length; i++){
|
||||
var pointcloud = viewer.scene.pointclouds[i];
|
||||
addPointcloud(pointcloud);
|
||||
}
|
||||
|
||||
|
||||
2495
src/viewer/viewer.js
2495
src/viewer/viewer.js
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user