[gameprogrammer] Re: issues with Calculating texture coordinates

Hi,

In the most simple case this will be alright. But I am looking at how those values are calculated. Yes for a simple triangle its as simple as this - just put 0,0, and 1, 1 and 0,1 etc appropriately. But lets say I had a 3d model with 100 vertices and I wanted to calcluate the texture coordinates then how would I do it ?

Hence I was looking at http://www.gameprogrammer.com/6-text.html and PCGPE.

Thanks
Gautam

[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




--------------------- To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: