AddMesh - which surface?

Blitz3D Forums/Blitz3D Programming/AddMesh - which surface?

dmoc(Posted 2003) [#1]
Clarification please: If I do an AddMesh which surface am I adding it to, last surface created? What if I have not created a surface yet? What if I want to use a specific surface?


DJWoodgate(Posted 2003) [#2]
If you want to use a specific surface then I think Sswift posted some stuff on the code archives that will let you achieve that. Addmesh will compare surface properties and if they are the same it will consolidate them.


dmoc(Posted 2003) [#3]
Cheers DJW for your answer. I checked the docs and the behaviour of AddMesh seems a little undefined, as in if ain't documented then you can't rely on it being consistent. There's no mention of a default mesh being created (in the case where one hasn't already), whether by default surface # 1 is used, etc, and clearly no way to specify which surface to use (hence sswift's code).

I'm not really concerned at this point what BB does with surfaces behind the scenes (almost a pun) but it does lead to other questions, eg, what happens when I "paint" a mesh? Does it overide all surfaces? Can I restore, ie, unpaint the mesh? Are brushes "sticky", ie, having painted a surface if the brush attributes are changed is the surface automatically changed? I think I know the answers but the thing is that if you forget, and it's not documented, you have to start trawling these forums for answers again and/or start writing little test apps. Both of which detract from coding your app.


DJWoodgate(Posted 2003) [#4]
Good point. And you know what, without writing a little test app I am not 100% sure on some of these questions either. Anyway my understanding at the moment:

Paintmesh paints all surfaces with the same brush. You may find its problematic to unpaint a mesh and restore it to a previous state, though in simple terms of course you just remember how you painted it in the first place, but thats assuming you did paint it in the first place and you have not complicated matters with addmesh or copymesh both of which will consolidate surfaces.

Brushes of themselves are not sticky. You can attempt to find a surface painted with a particular brush, so I guess you could code something along those lines yourself though this raises the question of uniqueness. If two brushes have identical properties can you find surfaces painted with each. The questions just never end do they :)


dmoc(Posted 2003) [#5]
True, true, the questions run deep ;-)