OpenGL Nurbs Surface/Dynamic Multi-Dimensional C Arrays Questions
OpenGL Nurbs Surface/Dynamic Multi-Dimensional C Arrays Questions
- Subject: OpenGL Nurbs Surface/Dynamic Multi-Dimensional C Arrays Questions
- From: Clinton Parsons <email@hidden>
- Date: Fri, 17 Oct 2003 16:37:28 -0600
I'm a relatively inexperienced programmer to C, Objective-C, and
OpenGL, and have spent quite a bit of time searching through apple's
site, opengl.org, nehe's site, and cocoa.mamasam.com, as well as
searching google for any worthwhile sites. Yet I still find myself
unable to program functional code to do the following:
Display a Nurbs Surface, the control points of which are constantly
being updated via a stream of NSNumber objects. The stream of NSNumber
objects, as they are currently, are contained in NSMutableArrays, which
in turn are contained in additional NSMutableArrays, representative of
the three dimensional aspect of a set of control points for a Nurbs
Surface in OpenGL.
The problem comes from needing the flexibility of the objective-c
format, and not being able to properly declare/allocate (malloc I
assume) a dynamic multi-dimensional C array to be sent as the 'control
points array' argument in the OpenGL command gluNurbsSurface(). Of
course the float values of the NSNumbers would be transfered into the
allocated C array before it was sent as an argument. The
multi-dimensional C array would need to have the option of varying in
the size of each dimension multiple times during execution. However,
the size of the variations is unknown at compile time.
As a side note, if I understand it correctly, It is unefficient to use
a bezier surface because, once displayed, the surface, in this example,
only needs to add a row on one end, and drop a row on the other,
maintaining the same size once displayed. The user needs to be able to
update the size of any dimension during execution.
If anyone can help me out with any ideas, It would be greatly
appreciated.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.