sandberg
Joined: 05 Oct 2005 Posts: 90 Location: Denmark
|
Posted: Tue Nov 29, 2005 11:23 pm Post subject: Linedrawing with 3D transform ?? |
|
|
Hi guys,
I'm working on some code, which I for developing wants to render using lines. But I can't get it to work. I've tried more or less anything but without any luck.
I'm able to render lines using 2D transforms, but using 3D transforms nothing shows up on the screen.
Does anybody here have a clue about why this doesn't work ? Isn't it possible to use 3D transforms for lines ?
I've tried to disable culling and the depthbuffer aswell but no changes there.
My coordinates lies in the range shown below
| Code: |
P1 : x=-1.000000, y=1.000000, z=0.000000
P2 : x=1.000000, y=1.000000, z=0.000000
P1 : x=-0.999010, y=0.999010, z=0.000000
P2 : x=0.999010, y=0.999010, z=0.000000
|
My structure for my coordinates (passed to sceGumDrawArray) is shown below.
| Code: |
struct Vertex
{
float x,y,z;
};
|
The code for rendering the lines are shown below.
| Code: |
sceGumMatrixMode(GU_MODEL);
sceGumLoadIdentity();
sceGuColor(0xFFFFFFFF);
/* Render springs */
for (int i = 0 ; i < nsprings ; i++)
{
p1 = cube_spring[i].from;
p2 = cube_spring[i].to;
struct Vertex* l_vertices = (struct Vertex*)sceGuGetMemory(2 * sizeof(struct Vertex));
l_vertices[0].x = cube_vertex[p1].p.x;
l_vertices[0].y = cube_vertex[p1].p.y;
l_vertices[0].z = cube_vertex[p1].p.z;
l_vertices[1].x = cube_vertex[p2].p.x;
l_vertices[1].y = cube_vertex[p2].p.y;
l_vertices[1].z = cube_vertex[p2].p.z;
sceGumDrawArray(GU_LINES, GU_VERTEX_32BITF | GU_TRANSFORM_3D, 2, 0, l_vertices);
}
|
_________________ Br, Sandberg |
|