oiiii, solving nurbs surface normals options

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

good news,

i managed to setup the surface normal salution that the mesa source currently utilizes. basicly it envolves creating two derivative tangent control meshes, one for each u and v tangents. the cross product of their samples is the normal.

tomorrow i might try to combine the two tangent meshes and essentially creating a control mesh of the cross product of the two. hopefully if this works, it would only mean sampling a single surface and not having to perform the per sample cross product.

i was worried i wouldn’t be able to wade through this stuff in a day.

here is a screen just for fun:

http://arcadia.angeltowns.com/share/nurbs-normals.jpg

using the combined cross product surface appears to yield equivalent normals… so i guess i’m where i wanted to be effeciency wise.

i have to wonder though… the normal surface is the derivative of the surface. for a quadratic surface this means the normal surface is linear. meaning the normals are linearly interpolated. maybe this is correct, but i have a hard time believing it. can anyone assure me that surface normals are linearly interpolated for a quadratic surface?

i tried doing the normals as a quadratic surface, but the ramp didn’t really look right, and it is convenient that the normal surface is lower order, because you can’t effectively solve the velocity of the last control point (without adding a ‘ghost’ point) because of boundary conditions. the lower order surface never touches the last control point, so it works out well.

whatever the case, i’m fairly certain that my calculations as far as normals are concerned are equivalent to the mesa evaluators implimentation.

sincerely,

michael

in follow up to my final concern regarding whether linearly interpolated normals are correct for a quadratic surface.

i’m not sure if this is a proof, but it holds up against the idea… basicly my thinking is that the normals of a linear surface are constants (or 1st order)… so it makes since that the normals of a quadratic surface would be linear (or 2nd order).

so i guess this thread is case closed.

doesn’t much look like the patrons here are too useful in the nurbs department.

now its time to seek out the most effecient way computationally of going about arriving at these results. i’m aiming for a linear algebra solution, but that is another thread.

sincerely,

michael

michagl it’s me bonehead what seems to be the problem? looks like you have a bad case of an improperly conditioned verbiage to productivity ratio.

can you summerize your question in just a few words?

complements,
bonehead

there are no problems left in this thread… no one helped out unfortunately. i eventually worked it all out myself… a functionally complete nurbs system from scratch in two days with no real prior knowledge does not seem like low productivity to me… though i admit the words in here were wasted.

if you can offer a matrix based solution for sampling nurbs parameters then you could help me out. there is another nurbs thread in the math section which describes the equivalent aproach for bezier surfaces.

if you don’t know nurbs, then please find someone else to stalk.

if you can offer a matrix based solution for sampling nurbs parameters then you could help me out.

if you don’t know nurbs, then please find someone else to stalk.
gee i dont know michagl…on the one hand you ask for help and on the other you accuse me of stalking you…

ill have to think about it.

Ditch the derivates if you want speed - the cross product on the evaluated polygons is faster. It may be less accurate, but then you really cant tell at high LOD’s.