Giter Site home page Giter Site logo

Comments (2)

potenziani avatar potenziani commented on June 11, 2024

Hi @coherit,
what you propose is certainly interesting (even though this kind of feature concern mostly PLY models, since usually the raw version of the Nexus geometries is soon visualized in 3DHOP), but unfortunately, at the moment, 3DHOP does not provide this kind of feature.

The main reason is that we suggest to rely on PLY geometries just for small models (so, with short loading times), and to convert in the Nexus format the bigger ones (we discussed a lot instead, and still are discussing, about the opportunity to integrate into 3DHOP a feature enabling a visual feedback for the loading of this last kind of models, that is not an easy task, since the amount of data loaded and to load continuously change depending on the camera position).

However, this does not prevent you to add to 3DHOP a custom component (like for instance, a loading bar) for providing visual feedback on data loading.

To build your own loading bar for PLY models is not too difficult: you just need to add a few code lines to "present.js", exploiting the "onprogress" event handler related to the "XMLHttpRequest" binary request. After doing that, you can add an HTML bar element linked to the data coming from this event handler.

You can find the PLY binary request at line 2909 of "presenter.js" (3DHOP 4.2 master version).
And this is an example of the original function with the "onprogress" event handler added:

sglRequestBinary(mesh.url, {
	onSuccess : (function(m){ return function (req) { that._onPlyLoaded(req, m, gl); }; })(mesh),
	onProgress : (function(loaded,total,evt){
		console.log(evt.url+" loaded: "+loaded+" of "+total);
		if (loaded==total) console.log("Model "+ evt.url +" ready!");
	})
});

With this change, you can have feedback on the amount of data loaded in the console for browser developers.

If you want a running example of that, take a look at the FCGL 3D data repository.

Hope this can help! :)

from 3dhop.

coherit avatar coherit commented on June 11, 2024

This is very helpful -- thanks for such a thorough reply! I'll give the loading bar a shot, and we'll reconsider converting to Nexus format again.

from 3dhop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.