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 

Vertex List question..

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



Joined: 04 Sep 2005
Posts: 15

PostPosted: Wed Nov 16, 2005 4:22 am    Post subject: Vertex List question.. Reply with quote

HI there

I am pretty new to 3d Programming and was wondering if somebody here could help me on the following question:

in the pspgu.h at the sceGuDrawArray I need to give a pointer to a vertex list.
I am playing around with the cube sample where it says:

Code:
struct Vertex
{
   float u, v;
   unsigned int color;
   float x,y,z;
};

struct Vertex __attribute__((aligned(16))) vertices[12*3] =
{
   {0, 0, 0xff7f0000,-1,-1, 1}, // 0
   {1, 0, 0xff7f0000,-1, 1, 1}, // 4
   {1, 1, 0xff7f0000, 1, 1, 1}, // 5....
 


in the pspgu.h it states:

* Vertex order:
* [for vertices(1-8)]
* [texture uv]
* [weights (0-8)]
* [color]
* [normal]
* [vertex]
* [/for]

obviously, on the vertex structure the author defined:
float u, v;
unsigned int color;
float x,y,z;

Can i simply put EVERYTHING i need in this structure (like normals etc.???) it is my understanding that I need to follow the above order but how is it that the 3 last x,y,z are not mistaken for normals but correctly taken as vertex coords??

I am also trying different formats and came across a few exporter for 3ds max.. However they seem to export the coords and then a seperate set of POLYGONS (basically a list of what points need to be connected with which points from the coords of an object.. in the Cube Sample they are listed in the correct order for drawing but if I want to use an existing exporter or take a COLLADA File, how to I use the vertex coords AND the Polygon Information to render it on PSP??

I am not sure if this makes sense but it's rather hard to explain :)

Any help or hint would be greatly appreciated!
Back to top
View user's profile Send private message
ufoz



Joined: 10 Nov 2005
Posts: 86
Location: Tokyo

PostPosted: Wed Nov 16, 2005 10:35 am    Post subject: Reply with quote

If you stick normals into your vertex structure, I think you will need to update the flags you pass to the DrawArray function with GU_NORMAL_???, then the PSP will know to look for a normal before the position.

For your second question, just stick the polygon info into an index buffer, and add a GU_INDEX_??? flag to your DrawArray call.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
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