[pspgu] help with index-list

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

Moderators: cheriff, TyRaNiD

Post Reply
maroxe
Posts: 18
Joined: Tue Sep 01, 2009 6:28 pm

[pspgu] help with index-list

Post by maroxe »

Hi,
Because of the lack of documentation of using index-list, i need your help.
Imagine i have three vertices:
V1: position: x1, y1, z1; texture: u1, v1; color: c1;
V2: position: x2, y2, z2; texture: u2, v2; color: c2;
V3: position: x3, y3, z3; texture: u3, v3; color: c3;
/* and so on */
I want to draw a vertex let's say with the position of the first vertex(x1, y1, z1) and the texture coordinatesof the second(u2, v2) and the color of the third(c3). Is it possible to do that with index-list? and if the anszer is yes, how? The vertex array must be like that:
{x1, y1, z1, u1, v1, c1,
x2, y2, z2, u2, v2, c2 ... }
or
{x1, y1 , z1, x2, y2, z2
u1, v1, u2, v2,
c1, c2}

??????????????????/
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Stop posting and bumping the same question. You've posted two possible answers -- can't you just try them and see?
maroxe
Posts: 18
Joined: Tue Sep 01, 2009 6:28 pm

Post by maroxe »

i tried both but no one worked: http://pastebin.archlinux.fr/358207
maroxe
Posts: 18
Joined: Tue Sep 01, 2009 6:28 pm

Post by maroxe »

anyone to help?
jsharrad
Posts: 100
Joined: Thu Oct 20, 2005 3:06 am

Post by jsharrad »

Look at the gu samples that came with the sdk
maroxe
Posts: 18
Joined: Tue Sep 01, 2009 6:28 pm

Post by maroxe »

jsharrad wrote:Look at the gu samples that came with the sdk
i didn't find aything iterresting. A part the vertex sample wich is a little bit complicated and doesn't exactly what i want it to do(it's just calculating, doesn't render anything at the screen)
jsharrad
Posts: 100
Joined: Thu Oct 20, 2005 3:06 am

Post by jsharrad »

check out samples/gu/common/gemoetry.c /.h
maroxe
Posts: 18
Joined: Tue Sep 01, 2009 6:28 pm

Post by maroxe »

well, i tried to draw a torus unsuccssefly

Code: Select all

     
/* Initialisation function */
vertices = (TCNPVertex*) malloc(sizeof(NPVertex) * 100);
     indices =  (unsigned short*) malloc(sizeof(unsigned short) * 9 * 9);
generateTorusTCNP(10, 10, 10, 1, vertices, indices);
texture = loadImage("texture.png");

/* Draw Function */

// transformations
rot += 0.01f;
sceGumRotateY(rot);
ScePspFVector3 pos = { -0, -0, -10 };
sceGumTranslate(&pos); 

//texture
sceGuTexMode(GU_PSM_8888, 0, 0, 0);
sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB);
sceGuTexFilter(GU_LINEAR, GU_LINEAR);
sceGuTexImage(0, texture->textureWidth, texture->textureHeight, texture->textureWidth, (void*)texture->data);

// draw
sceGumDrawArray(GU_TRIANGLES, TCNP_VERTEX_FORMAT, 10*10, indices, vertices);

But i got unexcepted result :( [/code]
maroxe
Posts: 18
Joined: Tue Sep 01, 2009 6:28 pm

Post by maroxe »

up
Post Reply