Nov 10
I have very few homeworks for this week turned in ... something
would be good, if only turning my simple_cards.py into
something that implements a real playing card deck.
Assignments for the remainder of the semester are posted -
I encourage you to plan accordingly.
For today : more examples of the sorts of things
that could be like final projects.
moby dick
$ time ./count_words.py
Counting words in 'moby_dick.txt'...
done. Processed 208433 words in 22447 lines.
Top 100 words are
1 14065 : the
2 6437 : of
3 6257 : and
4 4534 : a
5 4489 : to
6 4048 : in
7 2881 : that
8 2484 : his
....
- Continue discussion of possible final project topics.
"turtle" graphics
import turtle
for i in range(4):
turtle.forward(100)
turtle.right(90)
import turtle
turtle.colormode(255)
for i in range(100):
turtle.forward(i)
turtle.right(25)
turtle.color(((255-i),i,255), (0,0,0))
python random art
(f(x,y), g(x,y), h(x,y))
(sin(pi * x), cos(pi x*y), sin(pi * y))
pig latin
The code we wrote in class is attached.
blender
>>> c = bpy.data.objects["Cube"] # default object
>>> c.location = c.location + Vector((1.0, 0.0, 0.0)) # move it
>>> c.scale
>>> c.scale = Vector((2.0, 2.0, 2.0)) # change it's size
duplicating an object
To play around with this you'd need to explore the blender API and vocabulary:
mesh, scene, data block, ...
Animation is done through "keyframes" which are positions for objects
which are shown in sequence.
A common use for scripts is to add user GUI elements to Blender's
user interface, so much of the docs describe adding tooltips and so on,
not just generating content from the command or running a python script.
Your ideas ?