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 

[pspgu] help with index-list

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



Joined: 01 Sep 2009
Posts: 18

PostPosted: Thu Sep 03, 2009 6:23 am    Post subject: [pspgu] help with index-list Reply with quote

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
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Sep 03, 2009 9:20 am    Post subject: Reply with quote

Stop posting and bumping the same question. You've posted two possible answers -- can't you just try them and see?
Back to top
View user's profile Send private message
maroxe



Joined: 01 Sep 2009
Posts: 18

PostPosted: Fri Sep 04, 2009 1:00 am    Post subject: Reply with quote

i tried both but no one worked: http://pastebin.archlinux.fr/358207
Back to top
View user's profile Send private message
maroxe



Joined: 01 Sep 2009
Posts: 18

PostPosted: Fri Sep 04, 2009 10:02 am    Post subject: Reply with quote

anyone to help?
Back to top
View user's profile Send private message
jsharrad



Joined: 20 Oct 2005
Posts: 102

PostPosted: Fri Sep 04, 2009 10:28 pm    Post subject: Reply with quote

Look at the gu samples that came with the sdk
Back to top
View user's profile Send private message
maroxe



Joined: 01 Sep 2009
Posts: 18

PostPosted: Sat Sep 05, 2009 3:30 am    Post subject: Reply with quote

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
View user's profile Send private message
jsharrad



Joined: 20 Oct 2005
Posts: 102

PostPosted: Sat Sep 05, 2009 9:31 am    Post subject: Reply with quote

check out samples/gu/common/gemoetry.c /.h
Back to top
View user's profile Send private message
maroxe



Joined: 01 Sep 2009
Posts: 18

PostPosted: Mon Sep 07, 2009 6:37 am    Post subject: Reply with quote

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
View user's profile Send private message
maroxe



Joined: 01 Sep 2009
Posts: 18

PostPosted: Mon Sep 14, 2009 6:18 am    Post subject: Reply with quote

up
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