Comments (4)
I have done it in my current CityJSON-worker. If you want I can share my code with you.
It's unfortunately not that easy, as it is not possible to transfer Meshes/geometries over an web-worker. However I find a solution that works using BufferGeometry.
from ninja.
Thanks @fdahle, that's sounds really interesting! I've been thinking about decoupling the parsing of CityJSON from the viewer anyway, so I would be interested to see how you implemented it.
from ninja.
As already mentioned the most important part is that Webworkers cannot work with meshes/geometries, as these are not simple objects. So currently I'm converting my normal geometries into a BufferGeometry (Later I want to create BufferGeometries directly):
var bufferGeom = new THREE.BufferGeometry().fromGeometry(geom);
In order to not have such a high communication between the Worker and the MainThread I'm currently storing multiple BufferGeometries in a List and return this List to the Worker.
In my main thread I can directly use this bufferGeometry to create a mesh:
var mesh = new THREE.Mesh(bufferGeom, material);
This has furthermore the advantage of making the whole scene smaller, because as far I understood also the regular geometries use bufferGeometries internally.
If you have any questions or need the whole code example just write :)
from ninja.
Fixed with latest release (v0.4.0).
from ninja.
Related Issues (20)
- Visualise metadata lineage with a graph
- Zoom to feature
- Directionality of Network
- Support for adding more attributes
- A proper way to list arrays/dictionaries in ninja would be convenient.
- Listing LoDs of parents and children
- Selecting semantic surfaces HOT 1
- Icon for extension objects
- Support for CityJSON v1.1.0
- Visualizing LoDs HOT 1
- Resizing left-side menu
- Visualiser not working when not dragging exactly into the box HOT 1
- Allow users to set colours for object/surface types HOT 1
- Show parent attributes in children
- Please clarify the license HOT 1
- Chrome showing weird outputs on old hardware HOT 2
- Could not view noise-extension output HOT 3
- semantic output cannot be display HOT 1
- geometry templates mixed results in ninja HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ninja.