# Test data for hw7

```
You can test Assignment 7 easily yourself, unlike assignment 6.

To begin with you can assume your assignment 6 is correct - i.e. that the Mpar
Mper and Mperpar transformations are correct - so if you apply those to any
scene you end up with an equivalent scene in the 2x2x1 parallel box.

Therefore you need only debug the 2x2x1 parallel box view.  This is great as it
is really easy to draw scenes that fit inside the box - just make sure coords
of x,y,z are of absolute value less than one, and that z is negative. Also you
can tell whatthe right picture should be in a parallel box since projection is
so simple.

To set this up, we will take the view plane to be the back of the box (makes no
difference). Set the view coordinates to be exactly the canonical view volume
for parallel - ie DOP = (0,0,-1), VPN = (0,0,1), VUP = (0,1.0) VRP = 0,0,-1
window on view plane is -1 -1 to 1 1, F = 1 and B = 0.
Then the transformation Npar is just the identity and projection Mpar just
throws away the z coordinate.

Now draw two triangles of different colors with vertices inside the viewing box
(i.e. x and y in [-1,1] and z in [-1,0]) and display. By moving them one in
front of the other you can watch as your code recomputes the hidden surfaces -
best done interactively in a loop that calls end_frame() after drawing the two
triangles. You can see visually if your code works and you'll spot bugs
immediately.  You can try different configurations, including even intersecting
triangles - which will fail (ie display incorrectly) unless you have done
everything in depth sort.

Then move to three triangles of different color, which allows some crazy cases
where one triangle starts behind the second and ends up on front of the third ,
and even worse - all three tangled up, but not intersecting.

Finally you can test a single cube with 6 different color faces and then a pair
of cubes with one moving behind the other.  If all those cases work your code
is likely good.

After that you can set a real view - say two cubes viewed in perspective - and
it should come out perfectly. However it takes some effort to be sure the cubes
are in the perspective view volume - remember we have no clipping code in place.

Note: all of these can be tested with a) no steps implemented (just the
original Poly list), 1 step implemented (back face culling), 2 steps (sort on
zmin) and so one. So you can debug each addition to your code and see the
improvements.
```

Previous   Next