| View previous topic :: View next topic |
| Author |
Message |
peterstroeiman
Joined: 16 Sep 2005 Posts: 11
|
Posted: Fri Oct 21, 2005 1:52 am Post subject: Rendered objects are all black. |
|
|
Hi.
I have managed to render some objects on the screen. My vertices contain no color information, only coordinates
| Code: | struct Vertex
{
float x,y,z;
};
|
To set the colod I call
| Code: | | sceGuColor( 0xffffff00 ); |
Then render the objects using
| Code: |
sceGuDrawArray(
GU_TRIANGLES,GU_VERTEX_32BITF|GU_TRANSFORM_3D,
vertexCount,0, vertexData );
|
But the rendered objects are all black.
What am I doing wrong? |
|
| Back to top |
|
 |
Ryu
Joined: 17 Oct 2005 Posts: 19
|
Posted: Fri Oct 21, 2005 3:41 am Post subject: |
|
|
you have to use that structure:
struct Vertex
{
float u,v;
UINT color;
float x,y,z;
}; |
|
| Back to top |
|
 |
peterstroeiman
Joined: 16 Sep 2005 Posts: 11
|
Posted: Fri Oct 21, 2005 3:54 am Post subject: |
|
|
but..
I shouldn't put texture coordinates and color info in the struct if I don't specify a texture format and color format in the call to sceGuDrawArray.
And besides, my geometry seems correct, which means that the function sees the vertex format I specified. |
|
| Back to top |
|
 |
Ryu
Joined: 17 Oct 2005 Posts: 19
|
Posted: Fri Oct 21, 2005 4:03 am Post subject: |
|
|
| peterstroeiman wrote: | but..
I shouldn't put texture coordinates and color info in the struct if I don't specify a texture format and color format in the call to sceGuDrawArray.
And besides, my geometry seems correct, which means that the function sees the vertex format I specified. |
ok i read the h file again, i guess you can use any structure as long as it's aligned to 32bit which is the case for you |
|
| Back to top |
|
 |
mofig
Joined: 23 Aug 2005 Posts: 3 Location: Oregon
|
Posted: Fri Oct 21, 2005 5:21 am Post subject: |
|
|
| if you have lighting enabled you need to specify normals for your objects. |
|
| Back to top |
|
 |
peterstroeiman
Joined: 16 Sep 2005 Posts: 11
|
Posted: Fri Oct 21, 2005 5:33 am Post subject: |
|
|
I found out the problem.
I had texture mapping enabled, which I shouldn't when not using it. |
|
| Back to top |
|
 |
|