The group object

141 views
Skip to first unread message

Bruce Sherwood

unread,
Jan 12, 2024, 6:17:44 PM1/12/24
to Glowscript Users
Thanks to major help from Steve Spicklemire, plus useful comments by Ruth Chabay, there is a new feature in Web VPython (not yet available in the vpython module for installed Python). You can now create a "group" and place objects in that group. You can then move all the grouped objects together, with a single statement. In addition to moving the group, you can rotate the group, make all the objects invisible or visible, or change the colors of the objects.

Because this is brand new, the documentation is not yet in the Help, but here are two sample programs whose code you can examine to get the main ideas:

https://www.glowscript.org/#/user/Bruce_Sherwood/folder/Examples/program/group-car

https://www.glowscript.org/#/user/Bruce_Sherwood/folder/Examples/program/group-miscellany

Bruce

LORI REUBENSTEIN

unread,
Feb 5, 2024, 2:18:48 PM2/5/24
to Glowscript Users
I am very excited to see this new group option.  I miss frames.  However, I could not get it to work.  
I copied the car example into my local trinket and it said that group was undefined.

Lori

Harlan Gilbert

unread,
Feb 5, 2024, 2:36:25 PM2/5/24
to glowscri...@googlegroups.com
Works fine for me.  Are you using Web VPython 3.2?  Any earlier version will not function.

--

---
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/d52a1d16-a8c5-4430-8867-544426df76dfn%40googlegroups.com.


--
Harlan Gilbert, Ph.D.
High School Math, Physics, Computer Science, and Philosophy Teacher
Collegium Chair
Green Meadow Waldorf High School
Chestnut Ridge, NY 10977

LORI REUBENSTEIN

unread,
Feb 5, 2024, 4:18:02 PM2/5/24
to Glowscript Users
This doesn't work for me:


Web VPython 3.2

g = group()

box(group = g)

I get the message:  group is not defined At or near line 3:

Harlan Gilbert

unread,
Feb 5, 2024, 4:53:35 PM2/5/24
to glowscri...@googlegroups.com
Odd; both your and Bruce's programs work fine for me.



Bruce Sherwood

unread,
Feb 5, 2024, 5:46:54 PM2/5/24
to Glowscript Users
One possibility is that you need to clear the browsing data on your browser. I admit that it seems a long shot, given that the group feature has been available since Jan. 12, but it's the only thing I can think of that could explain this. You might also try a different browser.

Bruce

Bruce Sherwood

unread,
Feb 5, 2024, 5:49:32 PM2/5/24
to Glowscript Users
Oops. I do see what the problem is. You are writing programs at trinket.io, and it takes a while before a new feature at webvpython.org gets added to trinket.io by the Trinket staff.

Bruce

LORI REUBENSTEIN

unread,
Feb 5, 2024, 9:08:03 PM2/5/24
to glowscri...@googlegroups.com
I figured it was something like that.

Thank you

Lori

On Mon, Feb 5, 2024 at 5:49 PM Bruce Sherwood <bruce.s...@gmail.com> wrote:
Oops. I do see what the problem is. You are writing programs at trinket.io, and it takes a while before a new feature at webvpython.org gets added to trinket.io by the Trinket staff.

Bruce

--

---
You received this message because you are subscribed to a topic in the Google Groups "Glowscript Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/glowscript-users/imHHgoyMah8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to glowscript-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glowscript-users/c6ba9d1e-28be-4db2-8aac-2772f447a86cn%40googlegroups.com.


--
Lori Reubenstein
Math and Computer Science Teacher
Billerica Memorial High School
Reply all
Reply to author
Forward
0 new messages