Results 1 to 2 of 2

Thread: Can I do this with glTexGen ???

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2005
    Location
    Heidelberg, Germany
    Posts
    5

    Can I do this with glTexGen ???

    Hi everybody,
    I need to map a texture to a flat surface. The mapping of Texturespace to Objectspace is given by a mathematic formula (follows).
    To get the coordinates in the Objectspace to which a point on the texture is mapped is calculated by the following formula:

    X= ((1 + A*(sē+tē) + B*(sē+tē)ē ) *s + C ) * D
    Y= ((1 + A*(sē+tē) + B*(sē+tē)ē ) *t + E ) * F

    X,Y --> coordinates in ObjectSpace
    s,t --> coordinates on texture
    A,B,C,D,E,F --> constants (given at the beginning, they do not change)

    No, donīt get all like or , this is actually a pretty easy calculation.

    So, if you have a point on the texture, you can easily calculate the coordinates to which it will be mapped on the object.
    I havenīt found a way to do it the other way round (coord. on object given, look up point on texture). Iīm not sure if itīs possible at all.

    Iīve looked at glTexGen, but it only allows 4 parameters for the calculation. Or is there any other way ?

    Thanks in advance.

    ...philipp

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Posts
    314

    Re: Can I do this with glTexGen ???

    I don't think so.
    TexGen uses linear, cubemap or spherical mapping.
    What you have involves s and t to the 5th power.

    Besides, the texgen happens per vertex, not per fragment. The interpolation is still linear.

Similar Threads

  1. gltexgen + DLs
    By mithun_daa in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-13-2004, 01:44 PM
  2. Help me with glTexGen
    By fuxiulian in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 12-12-2003, 10:08 AM
  3. glTexGen
    By miko in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 03-06-2003, 03:33 AM
  4. glTexGen
    By HFAFiend in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 04-01-2001, 01:41 PM
  5. glTexGen*() ????????
    By SaF in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 03-11-2001, 02:54 PM

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