GU_TRIANGLE_STRIP

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

Moderators: cheriff, TyRaNiD

Post Reply
FumarMata
Posts: 1
Joined: Tue May 08, 2007 8:26 pm

GU_TRIANGLE_STRIP

Post by FumarMata »

Hello everybody

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

Image

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

    float fifi = 0.0f;
    float fk=0.0f;
    for&#40;int i=0;i<100;i++&#41;&#123;
        puntsCinta&#91;i&#93;&#91;0&#93;=i%2;
        puntsCinta&#91;i&#93;&#91;1&#93;=fk;
        puntsCinta&#91;i&#93;&#91;2&#93;=cos&#40;fifi&#41;;
        fifi+=.1f;
        fk+=.5f;
    &#125;
then I assign those values to "cinta", the struct which holds all the vertices:

Code: Select all

    for&#40;int i=0;i<100;i++&#41;&#123;
        cinta&#91;i&#93;.color=0xffffffff;
        cinta&#91;i&#93;.x=puntsCinta&#91;i&#93;&#91;0&#93;;
        cinta&#91;i&#93;.y=puntsCinta&#91;i&#93;&#91;1&#93;;
        cinta&#91;i&#93;.z=puntsCinta&#91;i&#93;&#91;2&#93;;
    &#125;
and then, I draw the triangle strip on the screen:

Code: Select all

	sceGumDrawArray&#40; GU_TRIANGLE_STRIP, GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D, 100, 0, cinta &#41;;
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
ector
Posts: 195
Joined: Thu May 12, 2005 10:22 pm

Post by ector »

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.
Post Reply