[gameprogrammer] Re: issues with Calculating texture coordinates
- From: "Olof Bjarnason" <olof.bjarnason@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Thu, 1 Jun 2006 15:14:03 +0200
if you just want to stretch the texture over the triangle in the
simplest, most basic way, just type something like
glTexCoord2f(0,0); // (0,0) is the top-left corner of texture
glVertex3f(0,0,-10);
glTexCoord2f(1,0); // (1,0) is the top-right corner of texture
glVertex3f(0,1,-10);
glTexCoord3f(1,1); // (1,1) is the bottom-right corner of texture
glVertex3f(1,1,-10);
good luck
/Olof
On 6/1/06, Gautam Narain <gautam_n_@xxxxxxxxxxx> wrote:
Hi Scott,
All I am trying to do is given a triangle in world coordinates -> <0, 0,
-10>, <0, 1, -10>, <1, 1, -10> calculate the texture coordinate using a
128x128 texture.
Thanks
Gautam
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
--
--~--~---------~--~----~------------~-------~--~----~
-~----------~----~----~----~------~----~------~--~---
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] Re: issues with Calculating texture coordinates
- From: Gautam Narain
Other related posts:
- » [gameprogrammer] issues with Calculating texture coordinates
- » [gameprogrammer] Re: issues with Calculating texture coordinates
- » [gameprogrammer] Re: issues with Calculating texture coordinates
- » [gameprogrammer] Re: issues with Calculating texture coordinates
- » [gameprogrammer] Re: issues with Calculating texture coordinates
- » [gameprogrammer] Re: issues with Calculating texture coordinates
- » [gameprogrammer] Re: issues with Calculating texture coordinates
- » [gameprogrammer] Re: issues with Calculating texture coordinates
Hi Scott,
All I am trying to do is given a triangle in world coordinates -> <0, 0, -10>, <0, 1, -10>, <1, 1, -10> calculate the texture coordinate using a 128x128 texture.
Thanks Gautam
--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html
--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- [gameprogrammer] Re: issues with Calculating texture coordinates
- From: Gautam Narain