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 

Cube Issue

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



Joined: 05 May 2005
Posts: 66

PostPosted: Mon Jul 25, 2005 3:18 am    Post subject: Cube Issue Reply with quote

Can someone just test out my verticies/indicies and see if you get problems, I can render fine in my DX app with this, but on the psp I see weird triangle issues.

Here is the code im using for the cube sample, I replaced the vertices with these and created an index buffer, but its not working, any ideas??

struct Vertex vertices[20] =
{
{-15.201900,0.000000,-17.577198},
{15.201900,0.000000,-17.577198},
{-15.201900,0.000000,17.577198},
{15.201900,0.000000,17.577198},
{-15.201900,22.327791,-17.577198},
{15.201900,22.327791,-17.577198},
{-15.201900,22.327791,17.577198},
{15.201900,22.327791,17.577198},
{-15.201900,0.000000,-17.577198},
{15.201900,22.327791,-17.577198},
{15.201900,0.000000,-17.577198},
{-15.201900,22.327791,-17.577198},
{15.201900,0.000000,17.577198},
{15.201900,22.327791,-17.577198},
{15.201900,0.000000,17.577198},
{-15.201900,22.327791,17.577198},
{-15.201900,0.000000,17.577198},
{15.201900,22.327791,17.577198},
{-15.201900,0.000000,17.577198},
{-15.201900,22.327791,-17.577198}
};

int indicies[36] =
{
0,3,2,
3,0,1,
4,7,5,
7,4,6,
8,9,10,
9,8,11,
1,7,12,
7,1,13,
14,15,16,
15,14,17,
18,19,0,
19,18,6
};

sceGuDrawArray(GU_TRIANGLES,GU_VERTEX_32BITF|GU_TRANSFORM_3D,12*3,indicies,vertices);


I basically get a bunch of triangles all over the screen, looks like somethings wrong, but can't tell what. Any clues??

Thanks a lot
Jeff.
Back to top
View user's profile Send private message
chp



Joined: 23 Jun 2004
Posts: 313

PostPosted: Mon Jul 25, 2005 5:19 am    Post subject: Reply with quote

You're passing a index-table to the GE, but you're making multiple mistakes while doing so.

a) the PSP does not support 32-bit indices. Change the index-list into unsigned short.

b) you do not set the vertex-format properly. For this data it should be: GU_VERTEX_32BITF|GU_INDEX_16BIT|GU_TRANSFORM_3D

Start with that and see if you're getting any closer.
_________________
GE Dominator
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