Jump to content

  • Log In with Google      Sign In   
  • Create Account


Lesson 43: How texture is rendered


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Sh@dow   Members   -  Reputation: 100

Like
0Likes
Like

Posted 17 June 2011 - 05:27 AM

In Lesson 43 to render a texture from free type font we are saying:

glBegin(GL_QUADS);
	glTexCoord2d(0,0); glVertex2d(0,bitmap.rows);
	glTexCoord2d(0,y); glVertex2d(0,0);

	glTexCoord2d(x,y); glVertex2d(bitmap.width,0);
	glTexCoord2d(x,0); glVertex2d(bitmap.width,bitmap.rows);

I can't understand what does this code do? We are drawing here two quads: first has all x = 0; What does this supposed to mean?
Thanks.

Sponsor:

#2 lc_overlord   Members   -  Reputation: 435

Like
0Likes
Like

Posted 17 June 2011 - 05:48 AM

no it's only one quad, if your doing texturing you need at least two sets of coordinates for each vertex, the first set given by glTexCoord2d signifies where on the texture you should read from and the second given by glVertex2d is the position on the screen, it's all really simple once you get a hang of it.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS