Advertisement Jump to content
Sign in to follow this  
chris95219

Texture Quad - Reading RECT from file

This topic is 4185 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I'm trying to draw a specific rectangle out of a texture onto a texture quad. I am having some trouble finding out what to set the U and V coordinates to. For example here is my prototype:
bgeSprite::DrawEx(bgeVector &source_pos, float source_width, float source_height,  bgeVector &dest_pos, float dest_width, float dest_height, float rotation, BGECOLOR *color)
As you can see the user can specify the source position (x, y) and the source size(width and height). They can also specify the destination position and size. How do I find out the U and V coordinates that map to what the user wants? TIA!

Share this post


Link to post
Share on other sites
Advertisement
It depends entirely on the texture, not on the size or position of the quad. To map the whole texture to the quad, you'd use UV coords of (0, 0) to (1, 1).

Share this post


Link to post
Share on other sites
lol, i know that part.. i was wondering how I would get the UV coordinates for each vertex though.. I finally got it though. Thanks anyways ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!