navigating the box

24 views
Skip to first unread message

Gilles Dubois

unread,
Jul 2, 2025, 3:08:01 PMJul 2
to VPython-users
The data members of the 'box' objects are rather strange, the referential that we can form from them is very different from the usual 'local referential' attached to a moving solid. Honestly I was a little lost first time to locate specific or generic point of a box. So I decided to write a simple program illustrating the construction of an orthonormal basis from axis and up and using it to locate specific points like the vertices.

Bruce Sherwood

unread,
Jul 2, 2025, 5:06:33 PMJul 2
to VPython-users
I'm not sure I understand your comment, but I'll point out that missing from the documentation is the bounding_box function:

b = box()
b.rotate(axis=vec(0,0,1), angle=pi/4)
print(b.bounding_box())

Bruce

Gilles Dubois

unread,
Jul 3, 2025, 4:23:37 PMJul 3
to VPython-users
Thank you Bruce. But in which order the points coordinates are listed ???
Let's make my comment simpler :
Why b.up is unitary ans b.axis is not ? It would be much simpler (length is given anyway)
Some box data is redundant length is norm of axis, no ?

Gilles Dubois

unread,
Jul 3, 2025, 4:42:36 PMJul 3
to VPython-users
Maybe like this

Bruce Sherwood

unread,
Jul 3, 2025, 4:50:37 PMJul 3
to VPython-users
The bounding_box() function simply provides the details of the bounding box of the object; no order is specified. Yes, there is some redundant information, essentially to provide flexibility in how one thinks about the object; sometimes you want the length, and sometimes you want that information in the form of a vector.

Bruce
Reply all
Reply to author
Forward
0 new messages