 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
ayatollah
Joined: 04 Sep 2005 Posts: 15
|
Posted: Wed Nov 16, 2005 4:22 am Post subject: Vertex List question.. |
|
|
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 |
|
 |
ufoz
Joined: 10 Nov 2005 Posts: 86 Location: Tokyo
|
Posted: Wed Nov 16, 2005 10:35 am Post subject: |
|
|
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 |
|
 |
|
|
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
|