the last couple days i’ve setup this nurbs system from scratch:
http://arcadia.angeltowns.com/share/gaea-cables3-hud.jpg
basicly i’ve generated the nurbs geometry (the dark stuff) from a common file format, and have stripped it myself.
today i’m faced with the problem of solving the surface normals.
there appears to be at least a few ways to go about it. and the book i’m working with does not go into surface normals… the closest it gets is curve derivatives. i’m also working with the mesa source, but its workflow is drasticly alien to my own (though it appears to make sense – just a bit convoluted). i can’t find any useful material online.
supposedly you can solve the derivative of a curve by building a control mesh out of the difference of the higher order control mesh. (by difference i mean ‘delta’ or:
control[k’] = control[k+1]-control[k]
for a cubic surface this would yield the velocity (first derivative/tangents) of the surface. from the cross product of the u and v tangents presumably you get the surface normal. i’m assuming if you set the control points rather to the resulting surface normals, you could then interpolate the normals (because otherwise you would have to keep two sets of mutually exclusive control meshes for both u and v, solve the interpolants individually and then take athe cross of the interpolants – mesa appears to do this from what i can tell, but mesa tends to be inefficiently construct as well from what i can gleam).
i’m not going to go through all this stuff one by one.
but basicly what my problem boils down to is a) i want to be able to get the normal fast. b) i need a random-access sampling model (versus sequential) and c) i don’t want to use cubic surfaces. that is i’m using quadratic surfaces for faster real-time sampling, and i can’t take the derivitive of that surface because it would be ‘acceleration’, which is linear, and can’t be used to interpolate normals.
modeling platforms, maya, rhino, etc, come up with normals from somewhere for a cubic surface, as i presume mesa/glut does as well.
i figure i’m thinking about this wrong headed.
i’m mostly looking for resources. i hope i don’t have to go as far as to pull out a differential calculus book and try to derive something of my own.
the absolute ideal solution which i’m shooting for would be to be able to generate a control mesh for generating normals. if you could just plug in the normal controls in place of the vertex controls and get a good normal that would be amazing.
please, i’m really desperate for assistance on this one.
i need resources mostly.
sincerely,
michael