New download capability

49 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Bruce Sherwood

ungelesen,
01.12.2021, 20:27:4501.12.21
an Glowscript Users
You can now use the download() function to write a text file into your computer's Downloads folder. In the "Files and Libraries" page of the Help is this description:

download: writing a file

Due to security issues, it is not possible to write directly from a browser to an arbitrary file in the user's computer storage. However, a browser can write to the user's download folder. In Web VPython you can write a string to the download folder using the download function:

download(filename, data)

Both the filename and the data must be strings. A useful way to create the data string is to use Python f-strings; see Text Output. Note that repeated execution with the same file name results in the later downloaded files having (1), (2), (3)..added .to the file name.

Bruce


Dale Griffiths

ungelesen,
04.12.2021, 16:45:1104.12.21
an glowscri...@googlegroups.com
Hi all, I'm getting some weird things going on here? All I want to do is to move the camera position and then to look back down at a green square.
What I wanted to do was to go on and simulate falling down toward the square as if skydiving so adjust the position of the camera as if you were accelerating down under gravity and you'd see the floor (apparently) accelerating up towards you. No idea what is going on though as the green square isn't visible and it seems to have put the camera at some random spot rather than the vec position I'd stated. Any ideas what I am doing wrong? and indeed how I could then resolve this. I've got lots of other ideas i want to play with by moving the camera so if i can't get this to work im a bit stuffed. Other ideas for example are to follow along with the parabolic projection of a golf ball.


Hiimage.png

--

---
You received this message because you are subscribed to the Google Groups "Glowscript Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to glowscript-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glowscript-users/5d64ae1f-d824-4659-930b-2d23603f5a94n%40googlegroups.com.

Bruce Sherwood

ungelesen,
04.12.2021, 22:39:3004.12.21
an Glowscript Users
I see that there is a big difference between trinket 3.1
and GlowScript 3.1. Apparently trinket 3.1 is an earlier
version of 3.1 and is missing corrections that were made
later. When I run the program at glowscript.org the print
statement shows <0,0,30>, not <0,0,1047.92>.

Bruce

Bruce Sherwood

ungelesen,
04.12.2021, 22:40:3404.12.21
an Glowscript Users
Also, I see that trinket doesn't yet support version 3.2.

Bruce
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten