Assignment 2

Modeling

**Date: Monday, October 11, 2010
**

**Due date:
Monday, Nov 1, 2010 @ 11:59
pm**

**Total Marks: ****100 marks + 10 bonus**

Write a program to model
curves and surfaces.

**Basic 2D Curves
(30 marks) **

Your task in this part
of
the assignment is to create an interface for modeling Bezier and B-Spline
curves. The following features
are
expected:

·
Ability
to add/remove/modify controls points (5 marks).

·
From
these control points allow for:

o
Creation of a 2D Bezier curve
with
the de Castleljau algorithm (5 marks).

o Creation of a closed/open cubic B-Spline curve with the subdivision algorithm (5 marks).

o
Creation of a closed/open quadratic
B-Spline(Chaikin) curve with the subdivision algorithm (5 marks).

·
Create
an interface for curves to be loaded from/saved to files (5
marks).

·
Control
tool for the number of subdivision used to represent the curve (5
marks).

**3D Surfaces (60
marks)**

In the second part of
the
assignment you are to use your 2D curves to create 3D surfaces. You may choose to implement this as
a
separate program from the first half of the assignment. Your program should allow
for:

·
Loading
from file or drawing curves as profiles (5 marks)

·
Creation
of a surface of revolution based on a curve Bezier profile (10
marks).

·
Creation
of a surface of revolution based on a quadratic B-Spline profile (10
marks).

·
Creation
of a B-Spline (cubic or quadratic) tensor product surface with either closed or open
boundary
conditions (one of these boundary cases is enough) (20
marks).

·
Control
tools for the number of subdivision steps and number of sample points
(samples
points refer to the points used to approximate the curves with line
segments)
(5 marks).

·
Read
and save the surface to and from a file (5 marks).

·
It
should be possible to see the surfaces rendered with a wireframe or with
triangles (5 marks).

**Bonus (10
marks)**

- Allow creation of cubic
B-Spline tensor product surfaces with open/open, open/closed and
closed/closed boundary conditions (5 marks)
- Create an interface for editing the control points for your tensor product surfaces (5 marks).

You must provide a
README
(preferably in PDF format).
This
file should contain:

- your name and login id and email
address,
- outline of the algorithms, data
structures, and design decisions

- All your source code must be written in
C/C++. Your source code must compile on the lab machines in MS 239
without
any special modifications. Your source code must be clear and well
commented.
- You are just allowed to reuse source
code:
(a) which has been provided by the instructor or the TAs for use in the
course, (b) which has been written by you which implements basic data
structures, such as linked lists or arrays, (c) which you have received
permission from the instructor or one of the TAs of CPSC 453 prior to
handing-in your assignment. Other sources are not acceptable for
reusing. You are not allowed to share your
code.
- Any instances of code reuse by you for
this
assignment must be explicitly mentioned within the README.pdf file.
Failure to do so will result in a zero in the source code part of the
assignment.

You are required to give
an
approximately 5 minute live demo to your TA, a schedule will be posted and
you
can sign up for a time slot. It is your responsibility to arrange for a
presentation with your TA. Failure to show up at the presentation will
result
in a zero in the assignment.