Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6851627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:16:17+00:00 2026-05-27T01:16:17+00:00

I am trying to map an image onto a NURBS surface. I have a

  • 0

I am trying to map an image onto a NURBS surface. I have a 13×13 array of equally spaced control points in a (-1, -1), (-1, 1), (1, 1), (1, -1) square. I am trying to map a texture onto the NURBS surface controlled by the control points using the following code:

gluNurbsSurface(nurbs_object,no_knots,&knots[0],no_knots,&knots[0],u_stride,v_stride,&ctr_points[0][0],u_order,v_order,GL_MAP2_TEXTURE_COORD_2);
gluNurbsSurface(nurbs_object,no_knots,&knots[0],no_knots,&knots[0],u_stride,v_stride,&ctr_points[0][0],u_order,v_order,GL_MAP2_VERTEX_3);
gluNurbsSurface(nurbs_object,no_knots,&knots[0],no_knots,&knots[0],u_stride,v_stride,&ctr_points[0][0],u_order,v_order,GL_MAP2_NORMAL);

The following are the parameters that I initialise my program with:

gluNurbsProperty(nurbs_object, GLU_SAMPLING_TOLERANCE, 50.0);
gluNurbsProperty(nurbs_object, GLU_DISPLAY_MODE, GLU_FILL);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image_width, image_height, 0, GL_RGB, GL_UNSIGNED_BYTE, image);

The problem I am facing is that I have the texture image repeating 4 times around the origin i.e. instead of a 2×2 texture, I have 4 1×1 textures.

Where am I going wrong? And how can I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:16:17+00:00Added an answer on May 27, 2026 at 1:16 am

    The texture has the coordinate range [0, 0] -> [1, 1]. Since the texture wrapping is set to GL_REPEAT by default, the coordinates used yield the 2×2 tiling you observe.

    EDIT:

    You’ll need to scale the NURBS surface used for the texture coordinates, or scale the texture coordinates some other way. The latter might be less intrusive:

    GLint mmode;
    
    glGetIntegerv(GL_MATRIX_MODE, & mmode); /* save active matrix stack. */
    glMatrixMode(GL_TEXTURE);
    glPushMatrix();
    glLoadIdentity();
    glScalef(0.5, 0.5, 1.0);
    
    /* ... draw ... */
    
    glPopMatrix();
    glMatrixMode((GLenum) mmode); /* restore active matrix stack. */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to map a texture onto a square where the texture stretches
I am trying to create a wpf control that will display a map image
I'm trying to figure out if this is possible.. I have an image map
I'm trying to highlight image map areas with jquery hover(), I have highlighting divs
I have image map where i am trying to open another page by using
I'm trying to display an array of postcodes onto a google map using PHP
Trying to map the following schema using the Entity Framework. A Customer can have
I'm trying to map a Dictionary containing Lists. I have the following set of
I am trying to map a different texture on each side of a cube
I am trying to understand the concept of texture mapping. I tried to map

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.