Results 1 to 5 of 5

Thread: Texture Mapping on Surface

  1. #1
    Senior Member Regular Contributor
    Join Date
    Jan 2001
    Location
    Derry, NH
    Posts
    126

    Texture Mapping on Surface

    Is there anyway to map a texture on a surface instead of a 2D-plane?

  2. #2
    Member Contributor
    Join Date
    Jul 2003
    Location
    Rhode Island
    Posts
    55

    Re: Texture Mapping on Surface

    I don't understand your question very well, i think you mean instead of 1 texture on 1 quad, have 1 texture on a whole terrain. In this case you would just change the UV for each quad.

    for example if you have one texture and a terrain 128x256 you would use an equation, (1/12*x for U;(1/256)*y for V, do determine the coordinates for each quad where X and Y are points on the terrain.

    I hope this could Help
    ZIX

  3. #3
    Senior Member Regular Contributor
    Join Date
    Dec 2002
    Location
    Poland
    Posts
    234

    Re: Texture Mapping on Surface

    Sure there is! It just depends on how is your surface described. You can check out "Evaluators & NURBS" in The Red Book. OpenGL (and glu) gives some features allowing to draw curves and 3d surfaces. From what I know, you can then apply a texture to this surface.
    Other solution is to divide your surface into number of triangles (or quads) and to map a texture on each primitive as if it was a 2D plane. It's really a way to do that! More or less it is how terrain is presented in some of games.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jan 2001
    Location
    Derry, NH
    Posts
    126

    Re: Texture Mapping on Surface

    Thank you zix99, thank you Orzech.

    I have never tried the first solution. I will try it.

    As to solution II, will it slow down the application and use a lot of video memory?

    Originally posted by Orzech:
    Sure there is! It just depends on how is your surface described. You can check out "Evaluators & NURBS" in The Red Book. OpenGL (and glu) gives some features allowing to draw curves and 3d surfaces. From what I know, you can then apply a texture to this surface.
    Other solution is to divide your surface into number of triangles (or quads) and to map a texture on each primitive as if it was a 2D plane. It's really a way to do that! More or less it is how terrain is presented in some of games.


    [This message has been edited by Rong Yao (edited 08-13-2003).]

  5. #5
    Senior Member Regular Contributor
    Join Date
    Dec 2002
    Location
    Poland
    Posts
    234

    Re: Texture Mapping on Surface

    Originally posted by Rong Yao:
    As to solution II, will it slow down the application and use a lot of video memory?
    You mean dividing your surface into primitves, right? No - it's one of the fastest ways of doing it. It all depends, of course, on a number of vertices and a method. You can do it easily without using video memory to save data. Storing all vertices in an array (for example GLfloat Vertex[100][3]) use mainborad memory and not the graphics cards one.

Similar Threads

  1. texture mapping a subdivision surface of a sphere
    By Ohmega in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-24-2011, 01:48 PM
  2. Texture mapping a NURBS surface
    By infinitecmdz in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-25-2005, 02:50 PM
  3. Texture mapping on Disk surface
    By tds in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-12-2003, 10:06 AM
  4. Texture mapping onto a curved surface
    By abhinav_80 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-06-2002, 09:29 AM
  5. Texture mapping onto a curved surface
    By abhinav_80 in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 08-06-2002, 05:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean