How to save 3d plot as rotatable html file
I'm using SAGEMATH in a Jupyter notebook on CoCalc. I have a rotatable 3d image and I want to save it as such.
If I go to (Grey) File/Download as html If I "EXPORT AS HTML" and click this now opens in the browser. Then I can scroll down to a particular 3d plot and click on the download error to the lower right of the image, and thereby take a nice screenshot with the perspective indicated.
What I want to do is save the html file of just this image, not the whole notebook. I know this is possible because I did it a year ago- but forgot to take notes on what worked, and have forgotten how!
Some of my plots I did with threejs and some with the default (not sure what that is). Both work in the same way.
Thanks for any suggestions!
Could you paste the code associated with the 3D image directly into a Sage terminal? That would launch a graphics window like this:
http://chem302.xyz/wp-content/uploads...
The icon in the bottom right hand corner allows you to save an image directly as html.
Thanks RyanG for the suggestion! I am not sure what you mean by "a Sage terminal".
I had installed sagemath on my notebook (a Mac) but it hasn't been working well for a while so I switched to CoCalc.
I thought maybe you meant a SageCell so I pasted my code into a SageCell. This ran fine, and now doing ctrl-click (on a Mac) opens up a menu for Jmol. In CoCalc the menu appeared but was inactive. So that is already really cool: I can produce stereo views, rotate at a constant speed. Also I can Export- say to X3D but I haven't figured that out yet.
There is no icon to save as html.
I then tried pasting the code into a sage notebook instead of a jupyter notebook in CoCal. This is worse: jmol as viewer gives error messages and so I used the default ...(more)
PS If I can figure out how to save as html, the next step I want to do is to create a 3d film which I know is possible for molecules in Jmol. I don't know if that is compatible with Sagemath. What I mean by 3D film is a 3d image which can be grabbed and rotated, as the film runs. An example is here under "Animation".
PPS a further dream would be to produce rotatable stereo pair views, and also animated...
I'm running Sage 9.0 on my MacBook and much of my work involves producing 3D crystal structures (three.js) files which can be saved as HTML (an example being the above link). Maybe update Sage to 9.0 with Homebrew on your Mac?