trackball rotation

14 views
Skip to first unread message

Jonathan Lettvin

unread,
Oct 9, 2025, 11:47:11 AMOct 9
to VPython-users
Normally, rotation of an object is around the object's already rotated axes.
Objects tumble unintuitively (i.e. down 90, then left 90 rotates the wrong axis).
I am planning to copy the axes out of the object, rotating using different math,
and copying the rotated axes back into the object.
Has this already been done in vpython, and how do I use it?

Bruce Sherwood

unread,
Oct 10, 2025, 12:57:38 AMOct 10
to VPython-users
Not sure I understand the question, but maybe this page on rotations in the documentation  may be helpful:


Bruce

Jonathan Lettvin

unread,
Oct 10, 2025, 1:52:28 AMOct 10
to vpytho...@googlegroups.com
Thank you, I have scrutinized that page much, and glad you sent the reference.  f3d offers an option to rotate objects as if mounted on your trackball.  Vpython does not.  If useful, I will write a MWE.py to illustrate. 

This e-mail is from Jonathan D. Lettvin, and may contain information that is confidential or privileged. If you are not the intended recipient, do not read, copy or distribute the e-mail or any attachments. Instead, please notify the sender and delete the e-mail and any attachments. Thank you.

Jonathan D. Lettvin

--
You received this message because you are subscribed to the Google Groups "VPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vpython-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vpython-users/2ad398c3-e316-46ce-81dd-74c04c28c74an%40googlegroups.com.

Jonathan Lettvin

unread,
Oct 10, 2025, 10:49:59 AMOct 10
to VPython-users
f3d offers an option to rotate objects as if mounted on your trackball.  Vpython does not.
Download f3d and use the following command line to see f3d at work:
Specifically, try rotation before and after toggling trackball mode using the 'k' key.
One mode tumbles unintuitively, the other mode feels natural.
I want Vpython to support the natural feeling one.

f3d paraboloid.obj \
--camera-position=0,10,0 \
--camera-focal-point=0,0,0 \
--camera-view-angle=45 \
--point-sprites-size=40 \
--point-sprites=true \
--background-color=0.5,0.5,0.5 \
-k

Contents of the file paraboloid.obj

# paraboloid.obj

o paraboloid

v +0 +0 +0 255 255 255

v +1 +0 +1 1 0 0
v +0 +1 +1 1 0 0
v -1 +0 +1 1 0 0
v +0 -1 +1 1 0 0

v +1 +1 +2 0 1 0
v +1 -1 +2 0 1 0
v -1 +1 +2 0 1 0
v -1 -1 +2 0 1 0


Reply all
Reply to author
Forward
0 new messages