Createsurface()

Blitz3D Forums/Blitz3D Programming/Createsurface()

Bnesiba(Posted 2006) [#1]
is there some way i can create/edit allready existing surfaces on a mesh?

ex: i load a mesh, and select 5 faces, and want these to form a new surface.. is this possible?

(createsurface() only creates surfaces for meshes made w/ blitz.


b32(Posted 2006) [#2]
yes, you could use getsurface(mesh, index%)
index is in the range 1..countsurfaces(mesh)


Bnesiba(Posted 2006) [#3]
that wouldnt work, i'm talking about changing a uv mapped/singlesurface mesh into a multisurface mesh. you cant set surfaces with getsurface, which is what i am trying to do.


Stevie G(Posted 2006) [#4]
It may be possible but could you put what you want to into a game related context? What type of model are you using .. is it vertex animated or just static geom? How are you selecting the poly's - via a UI? Assume you need to remove the 5 poly's from the original mesh when creating a new surface from them? Is your mesh unwelded?

Stevie


Bobysait(Posted 2006) [#5]
NewSurf=CreateSurface(Mesh)
then use addvertex(NewSurf,CoordX,Y,Z,U,V) and finally addtriangle

This work with loaded mesh !
To apply material to the surface Use Brushes functions => GetBrush, CreateBrush PaintSurface etc...


Bnesiba(Posted 2006) [#6]
ok, i'm trying to take a mesh, that has one surface, and without adding any verts or faces, split teh one surface up into 2 or 3...it could be animated or unanimated since i'm usinag a variety of meshes.


Ricky Smith(Posted 2006) [#7]
One way would be to rebuild the mesh from scratch using the original model as reference and splitting it into the seperate surfaces you require. You would need to know beforehand the indices of the verts and tris and which surface each "belonged" to. Not easy but possible.