Texture Quad - Reading RECT from file

Started by
1 comment, last by chris95219 16 years, 8 months ago
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!
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).
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 ;)

This topic is closed to new replies.

Advertisement