Computer Science 112
The Art & Science of Computer Graphics
Spring 2016, The College of Saint Rose
In this short "mini-lab" exercise that you can do any time over the next couple weeks, you will create a shared model in Ambrosia to contribute to a class shared model repository.
A Shared Model
You have created some very interesting models so far this semester, and we will use shared models to allow you to use each others' models as building blocks for the scenes you will be developing for the last few labs and for your final projects.
Our first experience with shared models was to build our marble models. Now, you will be creating a shared model of one or more of the other objects you have created this semester.
Please read back over the motivations for and description of how shared models are created on the marbles lab description before proceeding.
Procedure
Here is the process you should follow to create and publish your shared model.
__all__
" list. Here's mine:
__all__ = ( 'JTKey', 'JTSilverMat', 'JTGoldMat' )
Important note: there are two "_
" characters before and two
after the word "all
" in the above line.
from JTerescoKey import *
Alternately, you might import a single name as we did when importing your marbles and windows.
This file should show off your shared model object or objects in a simple setting, or just sitting in space.
Then, as with the marbles and stained glass windows, you would run that second model file to generate images, and your shared model file will be imported when needed.
if __name__ == '__main__':
Again, there are two "_
" characters before and two
after the words "name
" and"main
" in the above line.
What this does is allows us to run our shared model file as we normally would:
python3 JTerescoKey.py
to generate our image. However, when the file is used by including an import statement in some other model file, the code inside the indented if statement will not be executed. So the scene is not modified and no images are generated.
Your page should meet these requirements:
After submission, I will upload your model to the course web site, and will add a link to the shared model's wiki page so others can gather your model's code if they wish to use your model.
Bonus Opportunity: Additional Shared Models
You may contribute up to 5 additional shared models to earn up to 5 bonus points each. These models could include objects you have developed or are developing for labs or your final project, or you could develop brand new ones just for this purpose. To earn the full 5 bonus points, your submission must meet all of the requirements for shared models as described in this document. Please clearly indicate that your submission is a bonus shared model submission in the subject of your email. While the required shared model is due by 11:59 PM, Monday, April 18, 2016, bonus shared models will be accepted for credit through the end of the semester.
Using Shared Models
To use a classmate's shared model, simply download the model code (the .py file) into the folder where you're working and add the appropriate import statement. When you use a classmate's shared model in one of your models, be sure to give proper credit, both as a comment in your model file and as part of your image description on your wiki entry.
Grading
This assignment is worth 15 points, which are distributed as follows:
> Feature | Value | Score |
Shared model code properly defined | 5 | |
Code organization and style | 2 | |
Model documentation | 2 | |
Image(s) and model description on new wiki page | 5 | |
Emailed model code to be placed on site | 1 | |
Total | 15 | |