I've made an app to create a nurb terrain using gluNurbsSurface() and everything works fine, knots, control points and all. But how do you read back all the poly from the surface so it can be exported???
OpenGL Nurbs
Started by Alienizer, Aug 29 2012 03:11 PM
3 replies to this topic
#1
Posted 29 August 2012 - 03:11 PM
#2
Posted 30 August 2012 - 06:58 PM
I found the answer, which is...
You need to call...
gluNurbsProperty(theNurb, GLU_NURBS_MODE, GLU_NURBS_ TESSELLATOR);
Then you have to register a callback function...
gluNurbsCallback(theNurb, GLU_NURBS_VERTEX, (GLvoid (*)())vertex_callback);
Here is a simple callback function...
You need to call...
gluNurbsProperty(theNurb, GLU_NURBS_MODE, GLU_NURBS_ TESSELLATOR);
Then you have to register a callback function...
gluNurbsCallback(theNurb, GLU_NURBS_VERTEX, (GLvoid (*)())vertex_callback);
Here is a simple callback function...
void CALLBACK vertex_callback(GLfloat *vertex)
{
std::cout<<"("<<vertex[0]<<","<<vertex[1]<<","<<vertex[2]<<")"<<std::endl;
std::cout.flush();
}
#3
Posted 31 August 2012 - 10:44 AM
Because it happens, it's always a good idea to post your solution to your own question. You never know when someone comes looking for the same answer and is saddened when they read this post. I haven't touch GLU in ages, but I believe your solution was to use gluNurbsCallback, correct?
http://www.nutty.ca - Being a nut has its advantages.
#4
Posted 31 August 2012 - 06:39 PM
You're right! I didn't think of this. So I changed my post so people don't have to look down for the answer!
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












