AW
object that holds
the points
and faces
listsaw.py
module,
set up a AW
object (class) that it now contains the object's data:
points
(list of points, empty at initialization),
faces
(list of indeces to point list, empty at init),
group
(string, emtpy at init, i.e., ""
),
centers
(list of centers, empty at initialization), and
normals
(list of face normals, empty at init)
calc_normals(self)
, and
calc_centers(self)
read(self,filename)
method.
Thse methods are only called once.
np.array([0,0,0])
) A
and
B
and then compute the cross produce with
n = np.cross(A,B)
using numpy
.
point
that is located some distance along the normal
vector can be made local to the draw(self)
method. With two local variables center
and
normal
, the point along the vector is computed as
point = center + c * normal
GL_LINES
, e.g.,
glBegin(GL_LINES)
glVertex3f(center[0], center[1], center[2])
glVertex3f(point[0], point[1], point[2])
glEnd()
tar.gz
archive of your asg##/ directory, including:
README
file containing
.py
source)
handin
web page