Skip to content

Switch to three.js - #11

Open
juanblanco wants to merge 9 commits into
EinsteinsWorkshop:masterfrom
juanblanco:BlocksCADThreejs
Open

juanblanco wants to merge 9 commits into
EinsteinsWorkshop:masterfrom
juanblanco:BlocksCADThreejs

Conversation

@juanblanco

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

You can mouse panning using right click

@juanblanco

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

done

@mattminuti

Copy link
Copy Markdown
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

yoderjen commented Oct 2, 2015

Copy link
Copy Markdown
Contributor

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

@yoderjen

yoderjen commented Oct 2, 2015

Copy link
Copy Markdown
Contributor

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

yoderjen commented Oct 2, 2015

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor Author

I am sorry, I accidentally clicked close

@yoderjen

yoderjen commented Oct 2, 2015

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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