Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 3D-file-viewer component #1558

Merged
merged 8 commits into from
Jul 19, 2018
Merged

Add 3D-file-viewer component #1558

merged 8 commits into from
Jul 19, 2018

Conversation

btzr-io
Copy link
Collaborator

@btzr-io btzr-io commented Jun 6, 2018

Changes

A basic ThreeJS 3D viewer based on Autodesk/3DViewerComponent

Test

lbry://stl#b4f0c103be510a516c8ebb98ceb093dc745e7981

Todo (WIP)

Preview

@btzr-io btzr-io changed the title add threeViewer component Add threeViewer component Jun 6, 2018
@btzr-io btzr-io changed the title Add threeViewer component Add 3D-file-viewer component Jun 6, 2018
@btzr-io btzr-io mentioned this pull request Jun 6, 2018
14 tasks
@tzarebczan tzarebczan requested a review from neb-b June 8, 2018 19:23
@lbry-bot lbry-bot assigned neb-b and unassigned neb-b Jun 8, 2018
@neb-b
Copy link

neb-b commented Jun 8, 2018

@btzr-io Is this ready for review?

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 9, 2018

@seanyesmunt Maybe we should use a progress bar instead of the current spinner for the loading screen, What do you think?

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 9, 2018

@seanyesmunt So I think it's ready for review.

@neb-b
Copy link

neb-b commented Jun 12, 2018

Will check this out today!

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 12, 2018

ok, I'll setup a test branch...

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 13, 2018

@seanyesmunt Test branch: https://github.com/lbryio/lbry-app/tree/test-3d

@neb-b
Copy link

neb-b commented Jun 13, 2018

Hey @btzr-io. Probably won't get a chance to look at this until the redesign is live. This will be one of the first things that go in after that though.

@btzr-io btzr-io added the on hold Temporarily paused label Jun 16, 2018
@neb-b neb-b removed the on hold Temporarily paused label Jun 27, 2018
@neb-b
Copy link

neb-b commented Jun 27, 2018

Ok! Ready to get this in. I'm seeing Sorry, looks like we can't play this file. when I go to the file in your description. Not sure if this is from a recent change or your code.

Is this dependent on #1576?

@neb-b
Copy link

neb-b commented Jun 27, 2018

Oh I see that PR references this component, so it's the other way around. Ignore me

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jun 28, 2018

@seanyesmunt where did you test it? check the test-branch: #1558 (comment)
This is dependent of #1576 so you should probably review that one first ✌️

@tzarebczan
Copy link
Contributor

@btzr-io can you try lbry://stl? Not seeing anything but the grid when it first opens. Went out and back into the claim, then it worked.

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jul 8, 2018

@tzarebczan fixed in 5e1d6c2

@tzarebczan
Copy link
Contributor

@btzr-io tried an stl file yesterday on this branch and got "this file cannot be played".

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jul 13, 2018

@tzarebczan There is no implementation of the component yet 🙃

@neb-b
Copy link

neb-b commented Jul 16, 2018

Planning to merge this sometime this soon.

onStart: this.handleStart(this),
onLoad: this.handleReady.bind(this),
onError: this.handleError.bind(this),
onProgress: this.handleProgress.bind(this),
Copy link

@neb-b neb-b Jul 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to bind this in these functions. handleStart (and the others) uses the same this reference

Copy link

@neb-b neb-b left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very small comments. Also asking @skhameneh for a review. I will continue to test.


handleProgress() {
// const progress = (currentItem / totalItems) * 100;
// console.info(currentItem, totalItems, progress);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

manager.onError = onError;

return manager;
};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this function is being used? I see it being called below, but that value isn't being used.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const loader = Loader(fileType, manager);

@neb-b neb-b requested a review from skhameneh July 16, 2018 14:19
@lbry-bot lbry-bot assigned skhameneh and unassigned skhameneh Jul 16, 2018
@@ -2,6 +2,7 @@
import React from 'react';
import LoadingScreen from 'component/common/loading-screen';
import PdfViewer from 'component/viewers/pdfViewer';
import ThreeViewer from 'component/threeViewer';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this so it works, this component should probably live inside of component/viewers/... to keep it consistent.

@neb-b
Copy link

neb-b commented Jul 16, 2018

We are seeing some issues where the app becomes super un-responsive after viewing 3d files (I've had to restart twice after my computer freezes).

Will continue to test, but it should be simple stuff to help improve performance.

@skhameneh
Copy link
Contributor

Hey @btzr-io can you add debug info for geometry count?
@seanyesmunt is having trouble when working with a demo, his machine freezes when leaving the viewer.

I'd also like to note that it might be good to explore simplifying complex geometries before rendering:
https://threejs.org/examples/?q=simplifi#webgl_modifier_simplifier

@neb-b
Copy link

neb-b commented Jul 16, 2018

Possibly realated to running in dev mode. I shared the binaries internally and didn't hear any issues. I'll try running those.

@neb-b
Copy link

neb-b commented Jul 16, 2018

Seems to work fine with a binary. I'm guessing it was just from running in dev mode. Maybe we can simplify the geometry in dev mode? That should help.

@btzr-io
Copy link
Collaborator Author

btzr-io commented Jul 19, 2018

We are seeing some issues where the app becomes super un-responsive after viewing 3d files (I've had to restart twice after my computer freezes).

Not sure what you mean by after, the only time I'm seeing this issue is while loading the model:

Loading 3D model...

Looks like the loader is blocking the UI until the loading and parsing process of the file is completed
https://stackoverflow.com/questions/48636384/web-workers-for-loading-object-in-three-js

Maybe we can simplify the geometry in dev mode?

I tried to follow the webgl_modifier_simplifier example but the model disappears from the scene.

@neb-b neb-b merged commit 2d456f1 into master Jul 19, 2018
@btzr-io btzr-io deleted the three-viewer branch July 26, 2018 03:16
@btzr-io btzr-io mentioned this pull request Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants