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}
??????????????????/
[pspgu] help with index-list
i tried both but no one worked: http://pastebin.archlinux.fr/358207
well, i tried to draw a torus unsuccssefly
But i got unexcepted result :( [/code]
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]