best coordinate system to use?

26 views
Skip to first unread message

Erik the Anarchitect

unread,
Jul 14, 2016, 8:08:04 PM7/14/16
to VPython-users
I am a little bit frustrated because the coordinates seem to be defined as
x-y plane parallel to the point of view and z axis towards the viewer

but I feel that it's easier for me to think in terms of
x-y plane horizontal and z axis pointing up
because I want to make images of buildings by making a footprint and extruding it up.


Would simply twisting the camera take care of this?
Or do I have to do mental gymnastics every time I figure out the coordinates?

Kevin Karplus

unread,
Jul 14, 2016, 8:29:50 PM7/14/16
to vpytho...@googlegroups.com
Having xy be in the plane of the screen or paper with z-axis towards the viewer is a long-standing convention—people would be much more confused if you insisted on a different convention.  And finding things like the "z-buffer" on google would be very difficult if you insisted on calling it the "y-buffer".

You could always work on a tablet computer laid flat on a desktop.


Kevin Karplus   kar...@soe.ucsc.edu    http://www.soe.ucsc.edu/~karplus
Professor of Biomolecular Engineering, University of California, Santa Cruz
Program Chair and Undergraduate Director, Bioengineering
Undergraduate Director, Bioinformatics
Affiliations for identification only.

--
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.
For more options, visit https://groups.google.com/d/optout.

Aaron Titus

unread,
Jul 14, 2016, 9:30:21 PM7/14/16
to vpytho...@googlegroups.com
I suggest rotating the camera. Here is a sample program with +x to the left, +y out of the screen, and +z upward toward the top of the screen.


You can click “Edit” to see how to specify scene.forward and scene.up.

A word of caution. I wrote a program that modeled the motion of a steel ball on a plane that could rotate about two axes based on input from an Arduino. My student was comparing graphs of motion for the model and an experimental apparatus. One of the graphs wasn’t making sense. I then remembered that we had rotated the scene, and we were graphing the wrong variable. It’s easy to forget that you’ve rotated the scene (or rather the camera) unless you use this convention on a regular basis.

Aaron


Reply all
Reply to author
Forward
0 new messages