Changes between Version 2 and Version 3 of Ticket #12402, comment 65


Ignore:
Timestamp:
11/03/16 03:06:11 (6 years ago)
Author:
paulmasson
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12402, comment 65

    v2 v3  
    77The process here of creating 3D images exactly parallels that of 2D plots: a file is generated, saved to disc and displayed in the best possible viewer as determined by the rich output backend. It's not a local website, it's a file that can be saved and used elsewhere as desired, exactly as for static 2D plots.
    88>If you do something more serious that does try to integrate with Jupyter, you might find it is a lot of work to get Chrome with more than about 10+ 3d plots on the same page..  That was a big problem when I implemented WebGL based 3d graphics for SageMathCloud, which involved quite a bit of work (involving great care with the renderer, swapping things out with static png's etc.).
    9 I'm well aware of the limitations of multiple WebGL contexts in a single web page. The real way to handle this is using scissoring on a single renderer: I wrote an [https://threejs.org/examples/?q=mul#webgl_multiple_elements_text example] for the Three.js repository to do just that. Since this approach is not immediately modular, the fallback is to only load `iframe` content when it scrolls into view. While I was figuring out scissoring, a coding friend of mine [https://github.com/jaanga/jaanga.github.io/tree/master/documents/threejs-viewers explored] that very subject to [http://jaanga.github.io/documents/threejs-viewers/index.html good effect], so we have an available resource for dealing with this issue as well. It's also a topic for another ticket, since it would require modifying notebook behavior. I can't control all of that in the process of creating stand-alone files. The motivation here is to bring Three.js to the command line interface first.
     9I'm well aware of the limitations of multiple WebGL contexts in a single web page. The real way to handle this is using scissoring on a single renderer: I wrote an [https://threejs.org/examples/?q=mul#webgl_multiple_elements_text example] for the Three.js repository to do just that. Since this approach is not immediately modular, the fallback is to manage `iframe` content as it scrolls into view. While I was figuring out scissoring, a coding friend of mine [https://github.com/jaanga/jaanga.github.io/tree/master/documents/threejs-viewers explored] that very subject to [http://jaanga.github.io/documents/threejs-viewers/index.html good effect], so we have an available resource for dealing with this issue as well. It's also a topic for another ticket, since it would require modifying notebook behavior. I can't control all of that in the process of creating stand-alone files. The motivation here is to bring Three.js to the command line interface first.
    1010> Another question is how much of 3d plot rendering have you actually implemented?   For example, I recently added arrowheads to lines to SMC, since I had missed those and you expect them when plotting 3d vector fields.   I don't see any code in threejs_template.html for that.
    1111The code will currently render anything that returns a `json_repr`. This includes the `arrow` graphics primitive, which appears just fine, but not for example `text3d`. 3D vector fields don't have arrow heads in Sage 7.4 anyway, so that is something that can be added on another ticket.