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

Switch to three.js #11

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

juanblanco
Copy link
Contributor

viewer.js was heavily modified and renamed to threeViewer.js, files three.min.js, OrbitControls.js were included, lightgl.js was deleted, blockscad_build.py was modified to include these changes.
the 3d view looks indentical to the previous one with better touch respose tested on firefox on a old (2012 version) galaxy note 10.1.

@mattminuti
Copy link
Member

Awesome! Very responsive, and the structure looks much better than what we had before. I'd like to add mouse panning and do a couple tests before merging it into master, but this is great!

@juanblanco
Copy link
Contributor Author

You can mouse panning using right click

@juanblanco
Copy link
Contributor Author

I found a bug, when you pann the reset view button doesn't work as expected, I am working on this

@juanblanco
Copy link
Contributor Author

done

@mattminuti
Copy link
Member

Right-click panning works in Firefox and Chromium for me in e7bc1d5. Reset view after right-click panning works on both. Also feels much speedier, those this.controls.reset() additions helped! :)

@yoderjen
Copy link
Contributor

yoderjen commented Oct 2, 2015

Rotation and panning with the mouse is very sluggish for me on Chrome (firefox seems fine).

@yoderjen
Copy link
Contributor

yoderjen commented Oct 2, 2015

Zooming has also slowed down on both firefox and chrome (I have to turn the mouse wheel a lot more to achieve the same amount of zoom). On Chrome, it is slow enough to be very frustrating.

@yoderjen
Copy link
Contributor

yoderjen commented Oct 2, 2015

Even blockly has reduced performance for me on chrome, which makes no sense. Dragging blocks around is more sluggish than it used to be.

@juanblanco
Copy link
Contributor Author

three.js and lightgl.js are very diferent, three.js keeps a complete scene graph so it is more resource hungry than lightgl, I have interest in using three.js to implement mouse interaction in the scene, like selecting objects, animation and assembly. I think performance can be improved but a bigger library like three.js have some performance drawbacks that needs to be addressed.

@juanblanco juanblanco closed this Oct 2, 2015
@juanblanco juanblanco reopened this Oct 2, 2015
@juanblanco
Copy link
Contributor Author

I am sorry, I accidentally clicked close

@yoderjen
Copy link
Contributor

yoderjen commented Oct 2, 2015

I was interested in using three.js for being able to set transparency of objects. But Blockly performance in chrome is pretty bad in the current state.

@juanblanco
Copy link
Contributor Author

The original grid size was 20x20, the workspace volume now is 15 times larger than before, that maybe causes a big performance difference, I will decreased to 20x20

@mattminuti
Copy link
Member

Confirming crazy-high CPU usage in 031f5e0, using Chromium 45.0.2454.85 Ubuntu 14.04 (64-bit). 100% of a core without even rendering anything. Not seeing the blockly performance issues, but I'm guessing they're tied to the CPU usage.
It seems like it's tied to the render loop. We really only need to render when the view or contents have changed, but it looks like we're rendering at a full 60fps!

@juanblanco
Copy link
Contributor Author

yes I see it now, I will work on that

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.

3 participants