gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > rotscaling sprites

#157117 - pawob - Mon May 19, 2008 2:47 pm

I have been looking for which registers I have to modify to be able to zoom or scale. In the PAlib exists a function to change the "zoom" of a sprite:

Code:

inline void PA_SetRotset  (  u8  screen, 
  u8  rotset, 
  s16  angle, 
  u16  zoomx, 
  u16  zoomy
 )


But I have no idea about in the next structure with libnds I can scale sprites:

Code:

typedef struct  sSpriteRotation {
uint16 filler1[3];
uint16 hdx;
uint16 filler2[3];
uint16 hdy;
uint16 filler3[3];
uint16 vdx;
uint16 filler4[3];
uint16 vdy;
} SpriteRotation, * pSpriteRotation;


1.- Have I to set hdx,hdy,vdx,vdy at the same value to zoom?
2.- If it isn't the way, how I scale (zoon) a sprite?
[/code]
_________________
http://overrider.blogspot.com


Last edited by pawob on Mon May 19, 2008 2:49 pm; edited 1 time in total

#157118 - silent_code - Mon May 19, 2008 2:49 pm

check out tonc and read about affine sprites. as you might know, most transformations can be done with the matrix contained in the sprite rotation structure, not only rotation.
hope that helps! :^)
_________________
July 5th 08: "Volumetric Shadow Demo" 1.6.0 (final) source released
June 5th 08: "Zombie NDS" WIP released!
It's all on my page, just click WWW below.