Results 1 to 4 of 4

Thread: How to choose the texture which is not in rectangular form?

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2001
    Location
    Singapore
    Posts
    28

    How to choose the texture which is not in rectangular form?

    Hi all,

    How do I choose/make a 2D texture image using glReadPixels but the area of my interest is not a rectangular. The area could be a slunted rectangle, triangle or even a sphere? Anyone can help me please?

    regards,

  2. #2
    Member Newbie
    Join Date
    Jan 2002
    Posts
    32

    Re: How to choose the texture which is not in rectangular form?

    Hmm, i am interested for what you need that. How do you want to store the data?
    Could't you just read a rectangle and only use the required parts?

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2001
    Location
    Singapore
    Posts
    28

    Re: How to choose the texture which is not in rectangular form?

    hmmm... I still do not have any idea of what I will do.. may be I can consider your suggestion to let say get the smallest rectangle that enclose the area and use part of it which is the area of interest.

    But if we do that I still think that we don't actually solve the problem rite? we have just making the texture choice smaller by defining this small rectangle. We still have to get the area of interest which is not in rectangle form.

    FYI, in my application it will be something like this. eg the simplest, I have slunted rectangle A(0,0) B(2,1) C(2,4) and D(0,3) how should I get texture from this area of interest? Oh ya I have store the image in let's say an array called image.

    regards,

  4. #4
    Member Newbie
    Join Date
    Jan 2002
    Posts
    32

    Re: How to choose the texture which is not in rectangular form?

    I still have some difficulties in understanding how you wanna store the data. In your example, you have a slunted rectangle. When you read the data, do you wanna read it into a (rectengular) array?
    So, shall the read rectangle be unslunted that the pixels at the edges of each rectangle match?
    Well, this method won't work for other shapes like triangles or circles. Or do you simply read the smallest surrounding rectangle and your problem is how to determine where the edges are?

    [This message has been edited by plastichead (edited 01-22-2002).]

Similar Threads

  1. Rectangular texture gets repeated
    By symla_ in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-13-2014, 03:46 AM
  2. Blending Rectangular Texture
    By vncvnc in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-09-2009, 08:19 AM
  3. I cannot load texture form file.tga image
    By Dol AI with 3D Bone system in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-14-2004, 11:01 AM
  4. How do I make texture which is not a rectangular
    By songeb in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-19-2002, 08:04 AM
  5. How to choose the texture which is not in rectangular form?
    By songeb in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 01-21-2002, 04:23 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