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

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
arpaagent
Posts: 10
Joined: Thu Sep 06, 2007 12:50 pm

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

Post by arpaagent »

[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: Select all

            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: Select all

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: Select all

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!
Last edited by arpaagent on Thu Sep 06, 2007 11:13 pm, edited 1 time in total.
woo
Sdw
Posts: 29
Joined: Tue Jul 17, 2007 9:50 am

Post by Sdw »

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?
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

Hm, thought I submitted a fix for this a long time ago... Fixed in revision 2310.
GE Dominator
arpaagent
Posts: 10
Joined: Thu Sep 06, 2007 12:50 pm

Post by arpaagent »

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
chp
Posts: 313
Joined: Wed Jun 23, 2004 7:16 am

Post by chp »

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
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

just to verify, the fix is there now:
http://svn.ps2dev.org/diff.php?repname= ... =2310&sc=1
Sdw
Posts: 29
Joined: Tue Jul 17, 2007 9:50 am

Post by Sdw »

How do I verify which version of the SDK I have, and how do I update it if necessary?
Post Reply