GlowScript - 2D

閲覧: 75 回
最初の未読メッセージにスキップ

Per Henrik Hogstad

未読、
2022/04/04 5:38:192022/04/04
To: Glowscript Users
I want to use GlowScript for two-dimensional simulations.
What is the best way to do this?
I see that I can stop the possibility of rotation and scaling.
But I also want the z-axis to point normally out of the screeen, the x-axis to point to the right and the y-axis to point upwards.
Is it possible to rotate the coordinate system this way?

Per Henrik Hogstad

未読、
2022/04/04 9:15:332022/04/04
To: Glowscript Users
About 2D:
I found the solution myself:  scene.forward  = vec( 0, 0  ,-1)

Bruce Sherwood

未読、
2022/04/06 1:17:332022/04/06
To: Glowscript Users
This is puzzling. By default in VPython, x is already to the right, y is already up, and z is already out of the screen. I don't understand why you needed to point the camera in the direction that the camera is by default pointing.

Bruce

Per Henrik Hogstad

未読、
2022/04/06 9:37:502022/04/06
To: Glowscript Users
In VPython you have to use scene.forward then to program 3 dimensional applications?
Here is one of my GlowScript applications where I use 2D GlowScript (z-axis out of the screen:
Periodic Motion by making a hole through the earth

Mark Schaedel

未読、
2022/04/07 10:34:282022/04/07
To: Glowscript Users
I can't comment much on the 2D aspects, but this simulation is really cool and relevant to what I'm teaching in class this week. Thank you for posting it

Per Henrik Hogstad

未読、
2022/04/07 13:34:212022/04/07
To: Glowscript Users
Good if you can use the simulation, Mark!
If you are teaching periodic motion, perhaps you also want to use some of these simulations (they are programmed in SimReal/JavaScript and not by the help of GlowScript):
Horizontal SHMVertical SHM, Pendulum, Coupled Oscillation.
In the last one you have to change one of the positions (for example set x1 = 1) before start.
全員に返信
投稿者に返信
転送
新着メール 0 件