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 

Linedrawing with 3D transform ??

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



Joined: 05 Oct 2005
Posts: 90
Location: Denmark

PostPosted: Tue Nov 29, 2005 11:23 pm    Post subject: Linedrawing with 3D transform ?? Reply with quote

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
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