frame_to_world() : bug when doing a rotation of a "mother" frame

22 views
Skip to first unread message

Zizou

unread,
Jul 27, 2016, 1:52:55 PM7/27/16
to VPython-users
Hello,

I am trying to use frame_to_world() to get the position in "world coordinates" but it seems that when I am using this function, there is a bug when I use this kind of architecture :
- f_1 is a child of  the main frame "world"
- f_2 is a child of frame f_1
- box_1 is a box of f_2

Then, if I apply to frame f_1 a rotation (with f_1.rotate), the position of box_1 given by f_2.frame_to_world() does not change. However the position of box_1 is changing in the visualisation provided by vpython.

I believe it is a bug of the frame_to_world()
Am I wrong?


Second question : should I use Python 2.x or 3.x for Vpython?
Currently I am using Python 2.x

Best.

Bruce Sherwood

unread,
Jul 27, 2016, 11:02:31 PM7/27/16
to VPython-users
You're right, it's a bug. Apparently frame_to_world only works with one level of frames.

However, development of Classic VPython has halted, so this bug presumably will not be fixed. See


As to your second question, there isn't a Classic VPython for Python 3, because at the time of ending developmernt of Classic VPython there hadn't been a release for Python 3 of the wxPython library used by Classic VPython.

Jupyter VPython (see vpython.org) works on both Python 2 and Python 3, but although it is very close to the capabilities of Classic VPython, one of the few missing features is frame. It is intended to implement frame and extrusion in both Jupyter VPython and GlowScript VPython (which has a limited extrusion object). There are also a few recent developments in GlowScript VPython that have not yet been brought into Jupyter VPython: 3D text, and widgets -- button, radio button, slider, and menu.

Zizou

unread,
Jul 28, 2016, 4:08:04 AM7/28/16
to VPython-users
Thank you for your answer.

Do you think that if I play with the axis and pos of frames and objets, it will be "easy" to simulate the frame_to_world() fonction in such case with several frames?


Bruce Sherwood

unread,
Jul 28, 2016, 9:56:04 AM7/28/16
to VPython-users
In principle there's no reason you couldn't write your own function that does this calculation correctly.
Reply all
Reply to author
Forward
0 new messages