Results 1 to 4 of 4

Thread: how to texture mapping by an image of 450*500

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2002
    Location
    china
    Posts
    9

    how to texture mapping by an image of 450*500

    I have to texure mapping by an image of 450*500 , and the size is not standard and
    I mustn't zoom it,how can I do ?thank you!
    yang

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: how to texture mapping by an image of 450*500

    You have to load the image then pad it with saay zero's to make it 2^n dimensions and then when you texture map it you just alter your texture coords appropriately so that your image fits nicely on your quad without showing your padding.

  3. #3
    Member Newbie
    Join Date
    Oct 2002
    Location
    Rijeka, Croatia
    Posts
    36

    Re: how to texture mapping by an image of 450*500

    I will take the liberty and supplement what Gavin said.

    For 450*500 your nearest ^2 dimension is 512x512. So, pad the rest with zeroes.

    Then, draw a quad with SAME proportions
    (0,9 : 1), and use scaled texture coordinates:

    0.0, 0.0 for upper left corner
    0.88, 0.0. for upper right corner
    0.0, 0.976 for lower left corner
    0.88, 0.976 for lower right corner

    If this precision is not enough, just divide
    450 by 512 for X scale and 500 by 512 for Y scale.

  4. #4
    Senior Member Frequent Contributor
    Join Date
    Aug 2000
    Location
    Cardiff University
    Posts
    653

    Re: how to texture mapping by an image of 450*500

    Ooops forgot, look at mipmaps as well, you may find it easier.

Similar Threads

  1. BMP Image Texture Mapping
    By Satheesh chandra reddy in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 05-21-2014, 06:52 AM
  2. Texture mapping from image
    By chbaumberger in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 02-28-2011, 03:02 AM
  3. Texture mapping using a DDS image
    By Random89 in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 03-29-2009, 05:01 PM
  4. Need help in rendering 3D image with texture mapping
    By niterider in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 07-04-2001, 09:22 AM
  5. Need help texture mapping an image
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 04-01-2001, 08:27 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