 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
maroxe
Joined: 01 Sep 2009 Posts: 18
|
Posted: Thu Sep 03, 2009 6:23 am Post subject: [pspgu] help with index-list |
|
|
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}
??????????????????/ |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Thu Sep 03, 2009 9:20 am Post subject: |
|
|
| Stop posting and bumping the same question. You've posted two possible answers -- can't you just try them and see? |
|
| Back to top |
|
 |
maroxe
Joined: 01 Sep 2009 Posts: 18
|
|
| Back to top |
|
 |
maroxe
Joined: 01 Sep 2009 Posts: 18
|
Posted: Fri Sep 04, 2009 10:02 am Post subject: |
|
|
| anyone to help? |
|
| Back to top |
|
 |
jsharrad
Joined: 20 Oct 2005 Posts: 102
|
Posted: Fri Sep 04, 2009 10:28 pm Post subject: |
|
|
| Look at the gu samples that came with the sdk |
|
| Back to top |
|
 |
maroxe
Joined: 01 Sep 2009 Posts: 18
|
Posted: Sat Sep 05, 2009 3:30 am Post subject: |
|
|
| 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) |
|
| Back to top |
|
 |
jsharrad
Joined: 20 Oct 2005 Posts: 102
|
Posted: Sat Sep 05, 2009 9:31 am Post subject: |
|
|
| check out samples/gu/common/gemoetry.c /.h |
|
| Back to top |
|
 |
maroxe
Joined: 01 Sep 2009 Posts: 18
|
Posted: Mon Sep 07, 2009 6:37 am Post subject: |
|
|
well, i tried to draw a torus unsuccssefly
| Code: |
/* 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] |
|
| Back to top |
|
 |
maroxe
Joined: 01 Sep 2009 Posts: 18
|
Posted: Mon Sep 14, 2009 6:18 am Post subject: |
|
|
| up |
|
| Back to top |
|
 |
|
|
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
|