forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[FIXED, rev 2310] sceGumScale problem -- **BUG in pspdsk**

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
arpaagent



Joined: 06 Sep 2007
Posts: 10

PostPosted: Thu Sep 06, 2007 12:59 pm    Post subject: [FIXED, rev 2310] sceGumScale problem -- **BUG in pspdsk** Reply with quote

[edit]
After recompiling the sdk w/ pspgum.c with my recommended changes to sceGumScale, it worked correctly. I believe that this is a bug in the sdk and needs to be fixed in the next build.

Thanks
[/edit]

Hey guys,

I am trying to make a rectangle out of a square polygon by scaling it differently in each axis. This works fine until I rotate my object about the Z-axis...then it becomes skewed. It is almost like the rotation after the scale is not rotating the scaling. (so it stretches the object always along the same global axes, no matter which way it is rotated...it should stretch along the object attached axes) Is there something I am not doing right? I have tried switching the order of the rotate/scale but that doesn't matter.

Code:

            v3z scale;
            scale.glv.x = 20.0f;
            scale.glv.y = 5.0f;
            scale.glv.z = 1.0f;
            sceGumScale( &scale.glv );
            sceGumRotateZ( (float)val*PI/180.0f );


I was looking at the pspgum.c code and it is like this:

Code:

void gumScale(ScePspFMatrix4* m, const ScePspFVector3* v)
{
   float x,y,z;

   x = v->x; y = v->y; z = v->z;
   m->x.x *= x; m->x.y *= y; m->x.z *= z;
   m->y.x *= x; m->y.y *= y; m->y.z *= z;
   m->z.x *= x; m->z.y *= y; m->z.z *= z;
}


Should this instead be changed to this???:

Code:

void gumScale(ScePspFMatrix4* m, const ScePspFVector3* v)
{
   float x,y,z;

   x = v->x; y = v->y; z = v->z;
   m->x.x *= x; m->x.y *= x; m->x.z *= x;
   m->y.x *= y; m->y.y *= y; m->y.z *= y;
   m->z.x *= z; m->z.y *= z; m->z.z *= z;
}



Any insight into my problem would be of great help!!! I'd rather scale a square than create a rectangle any day!
_________________
woo


Last edited by arpaagent on Thu Sep 06, 2007 11:13 pm; edited 1 time in total
Back to top
View user's profile Send private message
Sdw



Joined: 17 Jul 2007
Posts: 29

PostPosted: Thu Sep 06, 2007 5:39 pm    Post subject: Reply with quote

I noticed this strange behavior as well when porting some code that worked fine on PC OpenGL to the PSP, but I just thought that things worked differently on the PSP.
A fix that would correct this behavior would be nice indeed!
I'm not that familiar with making changes to the SDK though (I just followed a tutorial to get it installed). What do I need to apply your fix?
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Thu Sep 06, 2007 7:22 pm    Post subject: Reply with quote

Hm, thought I submitted a fix for this a long time ago... Fixed in revision 2310.
_________________
GE Dominator
Back to top
View user's profile Send private message
arpaagent



Joined: 06 Sep 2007
Posts: 10

PostPosted: Thu Sep 06, 2007 10:28 pm    Post subject: Reply with quote

Hmm, well it certainly was not fixed in my version of the sdk which was distributed with the psptoolchain. I think it is 1.0+beta2 version that i am working with. Nor sure what revision that is, though. I also checked out the latest source drop pspsdk-20070626, and the source code in there still had not been fixed. So maybe you did submit the fix, but it apparently didn't make it to the code.
_________________
woo
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Thu Sep 06, 2007 10:47 pm    Post subject: Reply with quote

You should always use the SDK from subversion, the old releases are really ancient. and I hadn't submitted the fix, must have missed that when this issue was brought up the last time.
_________________
GE Dominator
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Sep 06, 2007 10:49 pm    Post subject: Reply with quote

just to verify, the fix is there now:
http://svn.ps2dev.org/diff.php?repname=psp&path=%2Ftrunk%2Fpspsdk%2Fsrc%2Fgum%2Fpspgum.c&rev=2310&sc=1
Back to top
View user's profile Send private message
Sdw



Joined: 17 Jul 2007
Posts: 29

PostPosted: Thu Sep 06, 2007 11:30 pm    Post subject: Reply with quote

How do I verify which version of the SDK I have, and how do I update it if necessary?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group