Page 1 of 1

[PB 4.45 RC1]Mesh creation question

Posted: Thu Jun 10, 2010 12:14 pm
by EdzUp
Hi am I to believe that the mesh creation system (as demonstrated in MeshManual.pb) is just for single surface meshes ie one texture per mesh.

I only ask as some of the stuff I have is multi-surface meshes and single surface meshes are a no-go.

Anyone have any ideas if this is possible or if there is a workaround it seems (from what I can glean from it) that you create your mesh in a array or data segment then point the SetMeshData to that with the relevant #PB_Mesh_Vertex etc and of it goes creating the mesh. I just want to know if multi-surface, multi-textured meshes are feasable with the current system or will I have to 'add' a feature request?

Re: [PB 4.45 RC1]Mesh creation question

Posted: Fri Jun 11, 2010 8:51 am
by Kelebrindae
I'm afraid it's not possible: you can't set any data about the material (except for UV coords) with the SetMeshData command => you can't create a multi-textured mesh at runtime.

Maybe you could do it with several meshes, thought...
- create one mesh containing only the triangles textured with Texture #1;
- create a second mesh containing the triangles textured with Texture #2;
- create 2 entities from the meshes and texture them with the proper material;
- attach the entities with attachNodeObject.
But that's overly complicated, and quite clumsy too... :roll:

Also, you could try the DirectX or OpenGL APIs (take a look at NeHe's tutorials), or another 3D engine like N3xtd :http://www.purebasic.fr/english/viewtop ... ilit=n3xtd

Re: [PB 4.45 RC1]Mesh creation question

Posted: Sat Jun 12, 2010 9:08 pm
by EdzUp
The only reason I asked is im trying to create Elite Multiplayer using the PB Internal 3d engine and not one I have written ( I can do a 3d engine im working on one at the moment called Tombstone but thats another story), this is why I asked if it was possible.

I will have to work a workaround probably using the multimesh thing.

Maybe this should be in the feature requests section :)

Re: [PB 4.45 RC1]Mesh creation question

Posted: Sat Jun 12, 2010 9:08 pm
by EdzUp
The only reason I asked is im trying to create Elite Multiplayer using the PB Internal 3d engine and not one I have written ( I can do a 3d engine im working on one at the moment called Tombstone but thats another story), this is why I asked if it was possible.

I will have to work a workaround probably using the multimesh thing.

Maybe this should be in the feature requests section :)