Opened 13 years ago

Last modified 3 years ago

#3702 new enhancement

Improve exporting 3d plots as X3D

Reported by: nbruin Owned by: was
Priority: major Milestone: sage-wishlist
Component: graphics Keywords: X3D
Cc: robertwb, jpflori Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: u/chapoton/3702 (Commits, GitHub, GitLab) Commit: da07572593a5bcbda92dada6a8b1013c1788549b
Dependencies: Stopgaps:

Status badges


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 (7)

comment:1 Changed 13 years ago by robertwb

  • Cc robertwb added

comment:2 Changed 10 years ago by jpflori

  • Cc jpflori added
  • Report Upstream set to N/A

comment:3 Changed 7 years ago by chapoton

  • Keywords X3D added

comment:4 Changed 7 years ago by chapoton

  • Branch set to u/chapoton/3702
  • Commit set to c99fe560b00780f4773d5dc5219151435d50c418

Here is a first step: transparency in x3d. Please review #7744 for the export of x3d files.

New commits:

c99fe56trac #3702 add transparency to x3d

comment:5 Changed 7 years ago by git

  • Commit changed from c99fe560b00780f4773d5dc5219151435d50c418 to 51c1e30c072a375ea515987867cbf7aa1c2e73ba

Branch pushed to git repo; I updated commit sha1. New commits:

51c1e30Merge branch 'u/chapoton/3702' into 6.6.b5

comment:6 Changed 7 years ago by robertwb

Looks mostly good. Is there any reason not to always print an opacity of 1 (to avoid repetitiveness of the code)?

comment:7 Changed 3 years ago by git

  • Commit changed from 51c1e30c072a375ea515987867cbf7aa1c2e73ba to da07572593a5bcbda92dada6a8b1013c1788549b

Branch pushed to git repo; I updated commit sha1. New commits:

da07572Merge branch 'u/chapoton/3702' in 8.7.b4
Note: See TracTickets for help on using tickets.