[gameprogrammer] Re: Help!

On Tuesday 30 August 2005 20:43, Sharu wrote:
> I am a bit new to game programming..
> My problem is tat i have written code to render some
> vertices in the shape of a box. the object is getting
> rendered fine along with the textures.
> However if i scale the object then the object size
> increases but so does the texture i.e the texture gets
> kind of stretched and doesnt look like the texture tat
> i initially had assigned.
>
> Is there a way to scale a object such tat the texture
> remains unaffected? If not is there any other way
> around this problem.
> Plz Help..
> Thank You for your time.

The best bet would be wrong texture coordinates after the scale.

Every digit means one pixel and every value translates to some colour

Rectangle (when rendered in the viewport) and the used texture
are both 8*8 pixels

original render: (and in fact the texture data as well)

00000000
00000000
00123400
00234100
00341200
00412300
00000000
00000000

scaled by factor of 2 in x and y directions

Is it like this?

0000000000000000
0000000000000000
0000000000000000
0000000000000000
0000112233440000
0000112233440000
0000223344110000
0000223344110000
0000334411220000
0000334411220000
0000441122330000
0000441122330000
0000000000000000
0000000000000000
0000000000000000
0000000000000000

or like this?

0000000000000000
0000000000000000
0012340000123400
0023410000234100
0034120000341200
0041230000412300
0000000000000000
0000000000000000
0000000000000000
0000000000000000
0012340000123400
0023410000234100
0034120000341200
0041230000412300
0000000000000000
0000000000000000

or something different?

And what is what you are trying to do?

> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html


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


Other related posts: