texture on NURBS surface with GLU doesn't show up

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

texture on NURBS surface with GLU doesn't show up

Manuel
Hello,
I have tried without success to map a texture on a NURBS surface using gluNurbsSurface. So far, the surface shows up fine, but without the texture. Here are the relevant fragments of my code:


GLUgl2 glugl2;    GLUnurbs nurbs;
float[] knots , ctrl_pts;
Texture t;    float[] t_knots , t_pts;

*** inside init:
glugl2 = new GLUgl2();    nurbs = glugl2.gluNewNurbsRenderer();
gl.glEnable(GL2.GL_AUTO_NORMAL);
knots = new float[]  {  0.0f , 0.0f , 0.0f , 0.0f , 1.0f , 1.0f , 1.0f , 1.0f  };
ctrl_pts = new float[]  {   ... 4 * 4 * 3 coordinate values ...  };
try  {  t = TextureIO.newTexture(new File("EarthMap_2500x1250.jpg") , true);  }  catch(Exception e) {}
t_knots = new float[]  {  0.0f , 0.0f , 1.0f , 1.0f  };
t_pts = new float[]  {  0.0f , 0.0f    ,    0.0f , 1.0f
                              , 1.0f , 0.0f    ,    1.0f , 1.0f  };

*** inside display:
t.enable();    t.bind();
glugl2.gluBeginSurface(nurbs);
glugl2.gluNurbsSurface(nurbs, 4 , t_knots , 4 , t_knots, 2 * 2 , 2 , t_pts, 2 , 2, GL2.GL_MAP2_TEXTURE_COORD_2);
glugl2.gluNurbsSurface(nurbs, 8 , knots , 8 , knots, 4 * 3 , 3 , ctrl_pts, 4 , 4, GL2.GL_MAP2_VERTEX_3);
glugl2.gluEndSurface(nurbs);
t.disable();


Many thanks in advance for any help,
Manuel
Reply | Threaded
Open this post in threaded view
|

Re: texture on NURBS surface with GLU doesn't show up

Manuel
Hello,
I have been told on another forum that apparently the implementation of NURBS in JOGL GLU is not complete and that it is necessary to use evaluators.

Is it really the case? Is the implementation still under way or simply missing?

Is there some kind of prospective data in the future about the fixing of this problem?
Manuel
Reply | Threaded
Open this post in threaded view
|

Re: texture on NURBS surface with GLU doesn't show up

gouessej
Administrator
Hi

The JOGL Java GLU implementation is not complete. As far as I know, there was a way of disabling it and using the native GLU implementation in JOGL 1.1.1a but I don't know if it is still possible with JOGL 2.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: texture on NURBS surface with GLU doesn't show up

Manuel
Hello,
I am so sorry to learn that.
Do you know if there is any plan to complete the JOGL GLU implementation, at least to be able to map textures on GLU NURBS?
Are there some people who are working on it?
Manuel
Reply | Threaded
Open this post in threaded view
|

Re: texture on NURBS surface with GLU doesn't show up

Sven Gothel
Administrator
On Tuesday, September 27, 2011 04:34:11 PM Manuel [via jogamp] wrote:
>
> Hello,
> I am so sorry to learn that.
> Do you know if there is any plan to complete the JOGL GLU implementation, at
> least to be able to map textures on GLU NURBS?
> Are there some people who are working on it?
> Manuel
>

'new GLUgl2();' should do the trick.

But using GLU.createGLU() or createGLU(GL)
as well. The 1st needs a current gl2 context,
the second a GL2 context as the argument to receive the GL2 GLU variant.

However, in the graph package there is a complete new GPU
accelerated variation of NURBS rendering.
Yes, we would need to add texture fetching for it,
now that you mention it :)

~Sven
Reply | Threaded
Open this post in threaded view
|

Re: texture on NURBS surface with GLU doesn't show up

Manuel

Hello,
it will be really great when it will be possible to apply textures on NURBS in JOGL GLU.

Right now, I am preparing a follow-up course to my course on Graphics in Java (in http://jogamp.org/wiki/index.php/Jogl_Tutorial) that will present more advanced features of JOGL. I am trying for this new course to define a small subset of JOGL features that is self-sufficient to do more advanced graphics. The only stumbling block I am facing is this inability to texture GLU NURBS. So I will be waiting impatiently for the fix.

As I see things, I consider more than ever that the couple Java-JOGL is the most appealing and sweetest way to program graphics. I am glad to contribute a bit with my courses to this approach.

Manuel