Computer Science 112
The Art & Science of Computer Graphics
Spring 2016, The College of Saint Rose
Instructor and Course Information
Instructor: | Dr. James D. Teresco, Albertus Hall 400-6, (518) 485-3755 |
Electronic mail: | terescoj AT strose.edu (best contact method) |
Twitter: | @JTeresco_StR_CS |
Class URL: | [Link] |
Class hour: | Monday, Wednesday 9:00-10:15 or 10:25-11:40 Science Center 469A |
Office hours: | Monday 3:00-4:00, Tuesday 3:00-5:00, Thursday 2:00-3:00, and by appointment |
Graduate assistant: | Sai Krishna Thaduri |
Graduate assistant hours: | Friday 10:00-12:00, Science Center 469A |
Course News
cd /Volumes/coolj342/cs112
Remember that a convenient way to do this is to type cd then "drag" the folder you want to be using from the Finder to the Terminal window, which results in this path being pasted right into your Terminal!
. 112
touch Sample.py
open -a Aquamacs Sample.py
Or from the Finder, right click on the icon for your .py file and choose "Open with..." then choose "Aquamacs".
python3 Sample.py
If all is well, you will see a series of messages and then your image or movie. If not, you will get some error messages, meaning you need to go back and correct something.
This section will contain descriptions of common problems that people encounter when using Ambrosia and what you probably did wrong. Please check your situation against this list before seeking help!
What Happened? | What Might I Have Done Wrong? | How Can I Fix It? |
Your cd command failed to switch to your course directory (with an error like "No such file or directory" | You might have spelled something wrong, had a space somewhere it should not be or did not have one where it should be, did not capitalize something. | Check your spelling, punctuation, etc.. and/or use the "drag folder to Terminal" trick to let the computer spell it for you. |
Your cd command failed to switch to your course directory (with an error like "No such file or directory" | You have not mounted your network drive yet. | Open a Finder window (double-click on the "Macintosh HD" icon), choose the "SAN4" or similar entry on the left, find and click on your username's folder in the big list. |
The "from ambrosia import *" statement produces an error like "ImportError: No module named 'ambrosia'" | You forgot to set up Ambrosia. |
Run the ". 112 " command before you run Python. It has to be
typed exactly: the period, followed by a space, followed by "112". |
The "from ambrosia import *" statement produces an error like "from: can't read /var/mail/ambrosia" | You are at the system prompt instead of the Python prompt. | First run the python3 command to get into Python. |
You are not seeing the "Edit" tab on your wiki page | You are probably not logged into your wiki account. | Log in! |
A statement like scene.add(...) produces an error like "NameError: name 'scene' is not defined | You have not imported Ambrosia. | Include the "from ambrosia import *" line. |
You see a "SyntaxError" | You have one or more statements that do not conform to the syntax rules of Python. | Python should have given a line number within your file where it detected a problem. Check for imbalanced parentheses, missing or misplaced commas, and similar things. Remember that the mistake is often on the statement before the one where Python indicated an error! |
You get no error messages but no image appears when you run your model. | You forgot the "camera.shoot()" statement. | Put it in! |
You get the message: "For some reason, Ambrosia generated neither an image nor an error file. This could be because: 1. Because of a problem in Python, or 2. Because there is a problem locating povray." instead of an image. | A surface image file is missing or not in PNG format. | Check that any surface image you are using is in the correct location, with the correct file name, and is in PNG format (recall that using a .png extension is not sufficient - the file must contain actual PNG data) |
You get the message: "For some reason, Ambrosia generated neither an image nor an error file. This could be because: 1. Because of a problem in Python, or 2. Because there is a problem locating povray." instead of an image. | Your model includes an invalid object, such as one with a negative size | Check your model for problematic objects. A good approach is to remove objects, temporarily, from your model until you can identify the offending object. |
You get an error like "RuntimeError: maximum recursion depth exceeded while calling a Python object" | You are likely adding an object, likely a Group to itself. This sometimes happens when you mistakenly reuse the name of an object as the name of a Group. | Check for that situation, and rename either the object or the Group. |
Texts
There is no text for the course. Links to relevant web pages and occasional additional readings will be made available when appropriate.
We will make extensive use of the Ambrosia Modeling System, developed by Duane Bailey at Williams College, and the documentation provided by that system.
Related Information and Links