Add 3D-file-viewer component #1558
|
@ -50,6 +50,7 @@ class ThreeViewer extends React.PureComponent<Props> {
|
||||||
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Select current theme
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
const { theme } = this.props;
|
const { theme } = this.props;
|
||||||
this.theme = this.themes[theme] || this.themes.light;
|
this.theme = this.themes[theme] || this.themes.light;
|
||||||
}
|
}
|
||||||
|
@ -102,9 +103,13 @@ class ThreeViewer extends React.PureComponent<Props> {
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
material.color.set(this.materialColors.green);
|
material.color.set(this.materialColors.green);
|
||||||
|
|
||||||
const mesh = new THREE.Mesh(geometry, material);
|
const mesh = new THREE.Mesh(geometry, material);
|
||||||
|
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
|
// Assign name
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
mesh.name = 'objectGroup';
|
mesh.name = 'objectGroup';
|
||||||
|
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
this.scene.add(mesh);
|
this.scene.add(mesh);
|
||||||
this.fitMeshToCamera(mesh);
|
this.fitMeshToCamera(mesh);
|
||||||
|
this.createWireFrame(mesh);
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
this.setControlsTarget(mesh.position);
|
this.setControlsTarget(mesh.position);
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
@ -112,7 +117,6 @@ class ThreeViewer extends React.PureComponent<Props> {
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
toggleWireFrame(show = false) {
|
toggleWireFrame(show = false) {
|
||||||
this.wireframe.opacity = show ? 1 : 0;
|
this.wireframe.opacity = show ? 1 : 0;
|
||||||
this.mesh.material.opacity = show ? 0 : 1;
|
this.mesh.material.opacity = show ? 0 : 1;
|
||||||
//this.mesh.material.shading(THREE.FlatShading);
|
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
}
|
}
|
||||||
|
|
||||||
fitMeshToCamera(group) {
|
fitMeshToCamera(group) {
|
||||||
|
@ -142,7 +146,6 @@ class ThreeViewer extends React.PureComponent<Props> {
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
group.position.y = meshY / 2 * scaleFactor;
|
group.position.y = meshY / 2 * scaleFactor;
|
||||||
group.position.multiplyScalar(-1);
|
group.position.multiplyScalar(-1);
|
||||||
group.position.y += meshY * scaleFactor;
|
group.position.y += meshY * scaleFactor;
|
||||||
this.createWireFrame(group);
|
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
}
|
}
|
||||||
|
|
||||||
setControlsTarget(point) {
|
setControlsTarget(point) {
|
||||||
|
@ -168,7 +171,6 @@ class ThreeViewer extends React.PureComponent<Props> {
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
handleReady() {
|
handleReady() {
|
||||||
// Handle load ready
|
// Handle load ready
|
||||||
this.setState({ isReady: true, isLoading: false });
|
this.setState({ isReady: true, isLoading: false });
|
||||||
this.toggleWireFrame();
|
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleResize = () => {
|
handleResize = () => {
|
||||||
|
@ -184,7 +186,8 @@ class ThreeViewer extends React.PureComponent<Props> {
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleProgress(url, currentItem, totalItems) {
|
handleProgress(url, currentItem, totalItems) {
|
||||||
/// Handle progress
|
// Handle progress
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
|
// TODO: Show progressbar...
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleColorChange(color) {
|
handleColorChange(color) {
|
||||||
|
@ -242,6 +245,7 @@ class ThreeViewer extends React.PureComponent<Props> {
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
window.addEventListener('resize', this.handleResize, false);
|
window.addEventListener('resize', this.handleResize, false);
|
||||||
} else {
|
} else {
|
||||||
// No webgl support, handle Error...
|
// No webgl support, handle Error...
|
||||||
|
// TODO: Use a better error message
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
|||||||
this.state({ error: 'No webgl support!' });
|
this.state({ error: 'No webgl support!' });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
You shouldn't need to bind You shouldn't need to bind `this` in these functions. `handleStart` (and the others) uses the same `this` reference
I think we will hold off on the progress bar for now, we have a progress percentage below the file. I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it. I think we will hold off on the progress bar for now, we have a progress percentage below the file.
I am going to add analytics for start to stream time, that will give us an idea of average time spent looking at the loading screen. If it's decently high I think we can add it.
|
You shouldn't need to bind
this
in these functions.handleStart
(and the others) uses the samethis
reference