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 

GU_TRIANGLE_STRIP

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



Joined: 08 May 2007
Posts: 1

PostPosted: Tue May 08, 2007 8:29 pm    Post subject: GU_TRIANGLE_STRIP Reply with quote

Hello everybody

I'm trying to build a simple triangle strip like this:



(a simple triangle strip) made of 100 vertices and bended in one axis. The problem is that on the screen, it's never just a strip. Lots of triangles go to what seems the 0,0,0 point

First I set up an array of vertices (that I will use for other calculations later)

Code:
    float fifi = 0.0f;
    float fk=0.0f;
    for(int i=0;i<100;i++){
        puntsCinta[i][0]=i%2;
        puntsCinta[i][1]=fk;
        puntsCinta[i][2]=cos(fifi);
        fifi+=.1f;
        fk+=.5f;
    }


then I assign those values to "cinta", the struct which holds all the vertices:

Code:
    for(int i=0;i<100;i++){
        cinta[i].color=0xffffffff;
        cinta[i].x=puntsCinta[i][0];
        cinta[i].y=puntsCinta[i][1];
        cinta[i].z=puntsCinta[i][2];
    }


and then, I draw the triangle strip on the screen:

Code:
   sceGumDrawArray( GU_TRIANGLE_STRIP, GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D, 100, 0, cinta );


Do you see something wrong there?

Thanks

Marc

ps. sorry if you saw this question in another forum, but I got no answers and I could not solve it
Back to top
View user's profile Send private message
ector



Joined: 12 May 2005
Posts: 195

PostPosted: Tue May 08, 2007 9:30 pm    Post subject: Reply with quote

Did you flush the data to memory, to make sure it's just not sitting in the CPU cache?
_________________
http://www.dtek.chalmers.se/~tronic/PSPTexTool.zip Free texture converter for PSP with source. More to come.
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