Results 1 to 5 of 5

Thread: Textures on 4 non coplanar points

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    23

    Textures on 4 non coplanar points

    I was wondering what's the behaviour of OpenGL when one tries to apply a texture on a square whose vertices do not lay on the same plane.

    What I would like to do is applying some textures downloaded from GoogleMaps on a squared elevation grid. Else you can advise me some other method? Should I triangulate the texures? If so how can I avoid to add discontinuities on the joints of triangles?

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Mar 2009
    Location
    Karachi, Pakistan
    Posts
    810

    Re: Textures on 4 non coplanar points

    Even if it is a square it will ultimately become a triangle. Then gl will simply use the texture u have given and apply it to the triangle.
    Should I triangulate the texures?
    What do u mean triangulate a texture?
    Regards,
    Mobeen

  3. #3
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,161

    Re: Textures on 4 non coplanar points

    Not a problem to texture a non co-planar quad. Textures can be applied to a sphere if you want. The texture you bind will apply to all the vertex coordinates you send to OpenGL for that batch. The more tesselated the model the better the result when the vertex positions are not in the same plane.

  4. #4
    Junior Member Newbie
    Join Date
    Mar 2010
    Location
    Italy
    Posts
    23

    Re: Textures on 4 non coplanar points

    I mean, I suppose that I should divide the square in at least two triangles and then apply that texture to each triangle.
    Let's say that I have a square with 4 vertices on 4 different altitudes. I can compute the altitude of the center of the square as a mean of the altitudes of the 4 vertices.
    Then I can divide the square in 4 triangles joining in the center of the square.
    The texture I have is a ortho projection of my "pyramid".
    How can I map correctly that texture on the 4 triangles composing my pyramid?
    Any help is much appreciated.

  5. #5
    Senior Member OpenGL Pro BionicBytes's Avatar
    Join Date
    Mar 2009
    Location
    UK, London
    Posts
    1,161

    Re: Textures on 4 non coplanar points

    you have to compute texture coordinates at each vertex.

Similar Threads

  1. Using textures instead of points in a map OpenGl-ES 2.0
    By Hank Finley in forum OpenGL: Advanced Coding
    Replies: 29
    Last Post: 09-09-2013, 07:57 AM
  2. Coplanar line and polygon
    By Alberto Jrr. in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-01-2008, 01:42 PM
  3. Need help drawing coplanar polygons
    By dmats in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 11-10-2008, 10:21 AM
  4. coplanar geometry
    By cru in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 11-20-2004, 03:48 PM
  5. Coplanar triangles substraction
    By TDurden in forum OpenGL: General
    Replies: 4
    Last Post: 02-13-2004, 10:06 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