Ticket #3702 (new enhancement)

Opened 5 years ago

Last modified 15 months ago

Improve exporting 3d plots as X3D

Reported by: nbruin Owned by: was
Priority: major Milestone: sage-wishlist
Component: graphics Keywords:
Cc: robertwb, jpflori Work issues:
Report Upstream: N/A Reviewers:
Authors: Merged in:
Dependencies: Stopgaps:

Description

After a little experimentation with viewing X3D files produced by SAGE, I found a couple of things that could hugely improve the usefulness:

  • Viewpoint: The standard viewpoint that gets written into X3D files does not seem to lead to a very good view. We could improve the ability to set the viewpoint (currently, <plot object>.viewpoint() gives a "not implemented" error), together with an orientation vector. A better default (and perhaps even some effort to compute a reasonable default) is a good idea.
  • Opacity: Currently this does not get written into X3D files at all.
  • Lighting: I couldn't find if that is supported at all at the moment.
  • Facet orientation: There is at least one viewer out there that "optimizes" its rendering by leaving out facets that are negatively/positively oriented from the viewpoint. We should check the X3D spec on whether this is a legitimate optimization in X3D. Even if it is not, it may still be a good idea to be "robust" in this respect by having an option to include facets in both orientation for, for instance, mesh objects.
  • Offering X3D files in the browser using the appropriate MIME type: When I tried writing an X3D string to a file in the notebook, the file appears, but when opened, it opens as a text file. If I save the file and approach the file locally via the browser, firefox does recognise the file as an X3D file and opens it using the preconfigured X3D viewer. This leads me to believe that the notebook serves the x3d file as a "text" file rather than an "x3d" file (why would it not?) If there is a way to tell the notebook to serve the link using the correct MIME type (the ".x3d" extension is a bit of a hint), viewing the X3D file (in this case, on a wall-filling screen, using 3D glasses) would be only one click away!

Change History

comment:1 Changed 5 years ago by robertwb

  • Cc robertwb added

comment:2 Changed 15 months ago by jpflori

  • Cc jpflori added
  • Report Upstream set to N/A
Note: See TracTickets for help on using tickets.