moving the camera position in 90°increments

31 views
Skip to first unread message

ali lolo

unread,
Mar 14, 2018, 10:31:38 AM3/14/18
to VPython-users
How can i write a program for moving the camera position in 90°increments ?

Bruce Sherwood

unread,
Mar 14, 2018, 11:02:03 AM3/14/18
to VPython-users
See the extensive documentation at 


Basically, you simply want to change scene.forward.

Bruce

ali lolo

unread,
Mar 14, 2018, 12:51:31 PM3/14/18
to VPython-users
And how can i work with vector variables in v python?
for example i can use a[n] for a list to change or get that index of array and how is it in V python?

Bruce Sherwood

unread,
Mar 14, 2018, 1:26:15 PM3/14/18
to VPython-users

a = vec(1,2,3)
b = vec(4,5,6)
print(a+b) # <5,7,9>
print(a.x, a.y, a.z) # 1, 2, 3


Study the many examples available at glowscript.org by clicking "Example programs"


Reply all
Reply to author
Forward
0 new messages