forums

TNT Basic Forums > Programming Q&A
Sprite Rotation/Scale
< Last Thread     Next Thread >
Author
Thread        Post A Reply

07-05-2007 22:10

Posted by:
Harbinger

Location:
Florida,USA

Click Here to Email Harbinger   Find more posts by Harbinger

When rotating a sprite (especially using low-level commands), if you then use the scale command on the sprite, does it alter the scale of the original sprite, or the rotated sprite?

IOW, let's say my sprite is a blue square. I rotate the thing 45 degrees and it makes a blue diamond. With me so far?

Now let's say i want to scale the width of the resulting sprite. If i use the low-level scale command to reduce the width, will the resulting shape be a thin diamond or a thin rectangle standing on one corner?

07-05-2007 22:57

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

Hi,

I didn't know either =P fortunately easiest way is to try


window mode hardware 800,600

load images 128

sprite 1,0,0,0

sprite 2,400,100,0
set sprite rotation 2,30
set sprite X scale 2,1
set sprite Y scale 2,0.5

sprite 3,600,100,0
set sprite X scale 3,1
set sprite Y scale 3,0.5
set sprite rotation 3,30

draw frame
wait mouse click


This little program seems to show that scale is always performed before rotation while drawing the image.

07-05-2007 22:57

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

BTW by "low-level functions" I assume you mean non-moan?

07-05-2007 23:24

Posted by:
Harbinger

Location:
Florida,USA

Click Here to Email Harbinger   Find more posts by Harbinger

No, MOAN are the low-level commands -- they're much quicker theoretically.

So you tested it? And found out that the sprite image is scaled and not its rotated image?

07-06-2007 00:32

Posted by:
someone

Location:
Quebec ( Canada )

Click Here to Email someone   Find more posts by someone

well i tested non-moan features, but i doubt moan would act any differently

and really, there is no function i nTNT i would call 'low-level' ;) moan is simply a small shortcut and i'm sure under the hood it shares the same code with other sprite functions.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.