Results 1 to 3 of 3

Thread: Texturing polygons

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2004
    Posts
    19

    Texturing polygons

    hey, this should be an easy one:
    I'm having a bit of trouble texturing a pyramid. I am texturing it with a bitmap so that all the faces have a different part of the bitmap on them, but only the bottom face works (the only face that is a quadrilaterlal). I'm not sure if my problem is due to my texture coordinates, or something else, such as OpenGL not being able to texture quadrilaterlals.

    Is it also just a freaky coincidence that all OpenGL tutorials I've EVER seen for texturing use just a cube? ...or am I just crazy/paranoid?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2005
    Posts
    115

    Re: Texturing polygons

    don't worry your not paranoid. You can texture map on triangles. Nehe has some great tutorials, tutorial 38 teaches triangle texture mapping. I havn't read it but the way I would texture map a triangle is just have two vertices for the top such as below.

    glTexCoord2f(0,0);
    glVertex2f(-1,0);
    glTexCoord2f(0,1);
    glVertex2f(0,1);
    glTexCoord2f(1,1);
    glVertex2f(0,1);
    glTexCoord2f(1,0);
    glVertex2f(1,0);

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2004
    Posts
    19

    Re: Texturing polygons

    actually, I discovered the problem was with the texture coordinates. It seems that blender's VRML exporter is broken, or does something strange to texture coordinates.
    switched to OBJ format,and the coordinates in the file look much more believable than they did with the wrl file.

Similar Threads

  1. Multi-Texturing and .... normal texturing?
    By Andy Gilbert in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-06-2010, 05:30 PM
  2. Texturing and Texturing (newbie)
    By Sudeepa in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-17-2008, 05:47 AM
  3. To display of concave polygons, polygons containing holes
    By deepa in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-13-2004, 09:22 PM
  4. Texturing tesselated polygons
    By MrGiskard in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-08-2004, 03:49 AM
  5. Enabled texturing = disapearing polygons
    By Kiamo in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-13-2002, 01:46 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