 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
sturatt
Joined: 13 Jul 2006 Posts: 46
|
Posted: Wed Apr 04, 2007 9:22 am Post subject: drawing with gu (translations and such) |
|
|
I guess ill start with what im trying to do. What i want to do is write an exporter for milkshape (a 3d modeling program) to write a custom model format. Ive looked into it a bit, and have come across something that im not quite sure how to handle. I always assumed that for bones and animation, there would be a very simple hierarchy:
bones have meshes, meshes have vertices
bones -> meshes ->vertices
After looking at milkshape, ive discovered that instead of that, the meshes and triangles formed from the vertices are seperate from the bones entirely, only the vertices are connected to the bones. This makes sense, since if have a mesh with two bones and you move one, you want to triangles between the bones to stretch, instead of creating a hole in the mesh.
my question about the psp is this: i only know of one way to draw with the gu, and thats sceGu(m)DrawArray(...) which takes a vertex and index list. If i am trying to draw a triangle that has say each of its vertices attached to a seperate bone, then each vertex will need to be transformed according to that bone right? how would i draw this triangle whose vertices are each transformed differently?
ive only ever thought about doing something like this
transform(x,y,z)
drawTriangles(index list, vertex list)
transform(x,y,z)
drawTriangles(index list, vertex list)
but i dont see how that can work if a triangle's vertices might need to be transformed differently
I hope that all made some sort of sense, and im sorry if this is a simple/stupid question =\ |
|
| Back to top |
|
 |
rapso
Joined: 28 Mar 2005 Posts: 147
|
Posted: Wed Apr 04, 2007 5:13 pm Post subject: Re: drawing with gu (translations and such) |
|
|
| sturatt wrote: | | After looking at milkshape, ive discovered that instead of that, the meshes and triangles formed from the vertices are seperate from the bones entirely, only the vertices are connected to the bones. This makes sense, since if have a mesh with two bones and you move one, you want to triangles between the bones to stretch, instead of creating a hole in the mesh. | in other animation programs the vertices are even assigned to more than just one bone, just imagin a face, the form of the lips are affected by several muscles, it wont be sufficient to have just one bone per vertex, they're then assigned to bones with specific weights, this is usually called skinning.
| Quote: |
my question about the psp is this: i only know of one way to draw with the gu, and thats sceGu(m)DrawArray(...) which takes a vertex and index list. If i am trying to draw a triangle that has say each of its vertices attached to a seperate bone, then each vertex will need to be transformed according to that bone right? how would i draw this triangle whose vertices are each transformed differently?
|
The PSPSDK has a sample for skinning, as the GU supports skinning with up to 8bones per mesh afaik. if you want to support more, you probably have to split your mesh into several trianglegroups. |
|
| Back to top |
|
 |
sturatt
Joined: 13 Jul 2006 Posts: 46
|
Posted: Thu Apr 05, 2007 5:12 am Post subject: Re: drawing with gu (translations and such) |
|
|
| rapso wrote: | | sturatt wrote: | | After looking at milkshape, ive discovered that instead of that, the meshes and triangles formed from the vertices are seperate from the bones entirely, only the vertices are connected to the bones. This makes sense, since if have a mesh with two bones and you move one, you want to triangles between the bones to stretch, instead of creating a hole in the mesh. | in other animation programs the vertices are even assigned to more than just one bone, just imagin a face, the form of the lips are affected by several muscles, it wont be sufficient to have just one bone per vertex, they're then assigned to bones with specific weights, this is usually called skinning.
| Quote: |
my question about the psp is this: i only know of one way to draw with the gu, and thats sceGu(m)DrawArray(...) which takes a vertex and index list. If i am trying to draw a triangle that has say each of its vertices attached to a seperate bone, then each vertex will need to be transformed according to that bone right? how would i draw this triangle whose vertices are each transformed differently?
|
The PSPSDK has a sample for skinning, as the GU supports skinning with up to 8bones per mesh afaik. if you want to support more, you probably have to split your mesh into several trianglegroups. |
thanks for the reply. I guess that was a silly question, since the sdk has an example of doing exactly what i asked. Whenever someone talked about skinning, i thought they meant applying a texture to a mesh or something along those lines.. thats why I didnt look at the skinning example, but I'll look at it now, thanks again =) |
|
| 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
|