| View previous topic :: View next topic |
| Author |
Message |
arpaagent
Joined: 06 Sep 2007 Posts: 10
|
Posted: Thu Sep 06, 2007 12:59 pm Post subject: [FIXED, rev 2310] sceGumScale problem -- **BUG in pspdsk** |
|
|
[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 |
|
 |
Sdw
Joined: 17 Jul 2007 Posts: 29
|
Posted: Thu Sep 06, 2007 5:39 pm Post subject: |
|
|
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 |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Thu Sep 06, 2007 7:22 pm Post subject: |
|
|
Hm, thought I submitted a fix for this a long time ago... Fixed in revision 2310. _________________ GE Dominator |
|
| Back to top |
|
 |
arpaagent
Joined: 06 Sep 2007 Posts: 10
|
Posted: Thu Sep 06, 2007 10:28 pm Post subject: |
|
|
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 |
|
 |
chp
Joined: 23 Jun 2004 Posts: 313
|
Posted: Thu Sep 06, 2007 10:47 pm Post subject: |
|
|
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 |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
|
| Back to top |
|
 |
Sdw
Joined: 17 Jul 2007 Posts: 29
|
Posted: Thu Sep 06, 2007 11:30 pm Post subject: |
|
|
| How do I verify which version of the SDK I have, and how do I update it if necessary? |
|
| Back to top |
|
 |
|