Multi-surface meshes using mesh creation commands

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
EdzUp
User
User
Posts: 30
Joined: Fri Aug 17, 2007 12:10 am
Location: Worthing, UK

Multi-surface meshes using mesh creation commands

Post by EdzUp »

Would it be possible to have a multi-surface mesh using PureBasic's SetMeshData and createmesh commands, maybe adding something like:

Code: Select all

MyMesh = CreateMesh( 0, 100, 3 ) ;create a mesh with three surfaces
;surface 1
SetMeshData(0, 0, #PB_Mesh_Vertex | #PB_Mesh_Normal | #PB_Mesh_Color, ?CubeData2, 8)
SetMeshData(0, 0, #PB_Mesh_Face, ?CubeDataIndex, 12)
CreateMaterial(0, 0, LoadTexture(0, "clouds.jpg"))
MaterialAmbientColor(0, #PB_Material_AmbientColors)

;surface 2
SetMeshData(0, 1, #PB_Mesh_Vertex | #PB_Mesh_Normal | #PB_Mesh_Color, ?CubeData2, 8)
SetMeshData(0, 1, #PB_Mesh_Face, ?CubeDataIndex, 12)
CreateMaterial(0, 1, LoadTexture(1, "clouds.jpg"))
MaterialAmbientColor(1, #PB_Material_AmbientColors)

;surface 3
SetMeshData(0, 2, #PB_Mesh_Vertex | #PB_Mesh_Normal | #PB_Mesh_Color, ?CubeData2, 8)
SetMeshData(0, 2, #PB_Mesh_Face, ?CubeDataIndex, 12)
CreateMaterial(0, 2, LoadTexture(0, "clouds.jpg"))
MaterialAmbientColor(2, #PB_Material_AmbientColors)

CreateEntity(0, MeshID(0), MaterialID(0))
As you can see there is a surface Id added to the creation and material commands this would allow for multisurface meshes. In Tombstone my engine I have a vector for the surfaces each surface catering for upto eight textures this is something that I think that PB would benefit from as nobody uses single surface meshes anymore.
User avatar
Innesoft
Enthusiast
Enthusiast
Posts: 105
Joined: Mon Jan 18, 2010 10:30 am
Location: UK
Contact:

Re: Multi-surface meshes using mesh creation commands

Post by Innesoft »

I looked briefly at the integrated Ogre, and found it too limited for my needs. While you wait for more Ogre features, give Next-D (irrlicht wrapper) a try. It's pretty much been abandoned (AFAIK) but it allows multiple mesh buffers (surfaces), and although it comes with limitations of it's own.. it does the job nicely.

I also want a more complete implementation of Ogre in PB, so +1 here.
Innesoft - The Software Marketplace - Innesoft Blog
» Applications, Educational Software, Casual Games
Post Reply