Open GL problem #2

Completado Publicado Jun 15, 2004 Pagado a la entrega
Completado Pagado a la entrega

Implement a pick procedure for the currently drawn Bezier curve;call it PickBezierCurve. It should accept an array of control points, a 2D point, and an integer tolerance (in pixels) as arguments, and returns a boolean value (true or false). It should return true if the given point is within the given tolerance of the curve (not the control points). This is how the PickBezierCurve should operate: It should create a bounding box around the current control points, increase the size of the box by the given tolerance, then test to see whether the point is inside the box. If not, it should return false. If so, it should one of two things. If the diameter of the original (unexpanded) box is less than 2.0, then return true. Otherwise subdivide the curve into two shorter curves, corresponding to the parameter ranges [0, 1/2] and [1/2, 1], and call PickBezierCurve recursively on the control points of each half. If either call is true, return true, otherwise return false. To perform the subdivision , use the concept of the blossom to find the new control points. It's up to you to decide a reasonable function to do this; it is recommended that your blossom function take an array of Point2s representing the control points and an array of floats (or doubles) representing the parameter values. Your function should accommodate any number of control points! Recall that in the case of a cubic Bezier curve ( i.e. four control points) the control points of the first half of the curve will be located at the points b[0,0,0], b[0,0,1/2], b[0,1/2,1/2], and b[1/2,1/2,1/2] where b represents the blossom. Be sure to retain the ability to pick the control points as well. In fact, you should always do the test for the control points first. If the pick operation fails on the control points (i.e. the user did not click close enough to them) then check the curve. If that pick also fails, then interpret the click as a point insertion operation, just as the original curve did. Add an interface button that turns bounding boxes on and off. That is, when the feature is enabled, it should draw each bounding box that is tested. The result should be something that is similar to the illustration in Farin's book. Continued below.

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.

b) For all others including desktop software or software the will install the software in ready-to-run condition on the platform(s) specified in this bid request.

3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

## Platform

Windows XP. C++ visual studio.

Continued from descripton field:

This feature will actually help you to debug your code. When the curve is picked and the cursor is moved while the left button is being held down, apply the resulting translation to all the control points simultaneously. This will cause the curve to move exactly with the cursor (due to affine invariance). Also remember to highlight the curve when it is picked, just like the control points.

Programación en C Ingeniería MySQL PHP Arquitectura de software Verificación de software

Nº del proyecto: #3247876

Sobre el proyecto

2 propuestas Proyecto remoto Activo Jun 17, 2004

Adjudicado a:

georgitsankov

See private message.

$42.5 USD en 3 días
(15 comentarios)
4.0

2 freelancers están ofertando un promedio de $47 por este trabajo

ussrvw

See private message.

$51 USD en 3 días
(14 comentarios)
2.2